Currently, I implemented a client and server application which use simple SOCKETs to communicate with each other. Like this.
The problem is that some users don't have a direct access to the internet, so they use proxys.
How can I use SOCKETs for a communication over a proxy (e.g. default IE proxy), or is there any other possibility?
First and foremost, there are different types of proxies and different types of protocols used by those proxies. There are HTTP proxies, SOCKS proxies, Tunneling proxies, etc. So first you need to decide what type(s) of proxies you want to support in your code, and then implement each of those protocols as needed.
In general, instead of
connect()
'ing directly to the desired server, the client wouldconnect()
to a proxy server instead and instruct it to connect to the server, using whatever protocol that proxy uses. Once that connection has been established, the rest of the client and server code wouldsend()
andrecv()
data normally as it already is, and the proxy would transparently exchange the data back and forth.