I have created a proxy server. Now i want to implement http tunneling in this.
My main class contain following code:

ServerSocket Server = new ServerSocket(localport);
Socket incoming = Server.accept();
Socket outgoing = new Socket(remotehost, remoteport);
*Now i am making use of InputStream and OutputStream for transporting the data
The proxy sever part is already completed. I have implemented two thread also, yet i forget to put the code here. There are two threads, one is for incoming traffic and another one is for outgoing traffic.

I want to add http tunnel in this code. Please suggest some way. If available, then please provide some example code for http tunneling.