Reputation: 4472
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
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