Like I said, you have to follow the correct proxy protocol you want to use to use and send the right data to the proxy server yourself in order to do this with sockets. You can google for the SOCKS4/5 proxy specification or the HTTP one (which is way easier for http connections). I don't have any examples off hand, but it should be as simple as sending the full URL in your GET/POST request for an HTTP proxy.