Hossein Mobasher
Hossein Mobasher

Reputation: 4472

Set custom Http Proxy over the TCP/IP Connection

Suppose that we want to connect to server with proxy="scs.msg.yahoo.com", port="5050", so we are using the internet connection with HTTP proxy like below :

Proxy : 192.168.4.10
Port : 8008
Username : username
Password : password

Now, how can i connect to my supposed server with TcpClient ? I wanna set Http proxy in my code and do not want to set it directly by changing Lan Settings in IE

Upvotes: 0

Views: 1948

Answers (2)

Ehsan Mirsaeedi
Ehsan Mirsaeedi

Reputation: 7592

You just need to make a tcp connection to your proxy server. you have to make a http message on your own and set authentication header fields. so at first you have to know which authentication scheme does your proxy server use. by the way, you can use HttpWebRequest and HttpWebResponse classes to handle http messages and also use proxy server.

Upvotes: 0

Daniel B
Daniel B

Reputation: 2887

According to this post, it cannot be done without some additional code. The top rated answer gives a link to an open source, 3rd party implementation.

Upvotes: 2

Related Questions