connection through proxy server
-
Hi, my chat client is easily connecting to the Server program using Sockets (in c-sharp). But now i want to provide the functionality in my chat client program to be able to connect through proxy. How can I do this. Besides, I see in MSN, that there are 3 types of Proxy setting in it i.e. - SOCKS VERSION 4 - SOCKS VERSION 5 - HTTP Proxy would it make a major difference in the client side coding if i have to support all the above types? A prompt reply will be appreciated. Regards, Kamran
-
Hi, my chat client is easily connecting to the Server program using Sockets (in c-sharp). But now i want to provide the functionality in my chat client program to be able to connect through proxy. How can I do this. Besides, I see in MSN, that there are 3 types of Proxy setting in it i.e. - SOCKS VERSION 4 - SOCKS VERSION 5 - HTTP Proxy would it make a major difference in the client side coding if i have to support all the above types? A prompt reply will be appreciated. Regards, Kamran
Your protocol has to be defined to work with proxies - it isn't automatic. The only advice anyone can really give you is to read the RFCs from http://www.ietf.com/rfc[^] for those proxy types to determine how you could include them along with your protocol definition. HTTP, for example, allows for proxies. This is why the HTTP-related classes (like
HttpWebRequest
) support proxies (a la theWebProxy
) in the .NET BCL. It's common enough to warrant inclusion in the .NET BCL. How other protocols work with proxies is up to the protocol authors. Many typically work the same (there's a lot of HTTP-like protocols, like SMTP, DICT, etc.) so I'd imagine the proxy support works the same, making it easy to use the same proxies. What I'd recommend is using a good OO design to encapsulate yourSocket
client in a class and actually make use of theWebProxy
for consistency (so people can reuse the same proxy;WebProxy
also defaults to using the Internet Explorer settings for proxies, making it easy for your users to default to settings they might've already configured). You still need to work out how it'll work with your chat protocol, though. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]