I have a piece of code to connect to a Socket server, and it works fine.
Socket socket = new Socket();
socket.connect(new InetSocketAddress(address, port));
Am I correct in saying that what you want is to use the http proxy (for exemple squid) to establish a CONNECT method to a remote server (from http rfc 2616)? Basically, the connection goes like this:
-open a socket to the proxy (host, port)
-send text to the proxy with basic header
....CONNECT remote.internethost.com:1494 HTTP/1.0
....User-Agent: Java Proxy Socket version 1.0a
....Host: remote.internethost.com
....Proxy-Authorization: Basic YourBase64usernamePasswordIfRequired
-then, the proxy will return a http status code (multiline text string) and the actual socket (if successfull)
-this is this socket that needs to be returned to the connection object
That could be done with personal classes but the beauty would be to reuse the proxy classes for it. This way, all the handshake with the http proxy, especially the response code would be handled.