Re: Sending Connect request

rajev samyal wrote:

>  Hi! I have a client application which is running behind a proxy
>  server. I want to connect to another server application in another
>  domain.I am using Http to connect to the server.The problem is how do
>  I pass the information across the proxy to the server and get the
>  response back.I have read of CONNECT method in the Request header,
>  but don't know how to implement it. What I could get from reading

A bit of googling should have given you:
http://ftp.ics.uci.edu/pub/ietf/http/hypermail/1997q3/0777.html
or:
http://www.web-cache.com/Writings/Internet-Drafts/draft-luotonen-web-proxy-tunneling-01.txt

Anyway your idea seems correct.
1)  Client sends a requests with the method CONNECT, the request can be 
a full request
so there may be some headers folliwing the request-line.

2)  The proxy can send a response with response code 200 (which means 
that there is a
tunnel ready to be used. The proxy could also send a response with a 4xx 
or 5xx code
which means that you can not use the proxy as a tunnel.

3) If the response was a 200, send data, and read data as you want, the 
proxy will not
interfere (you should not have to care about the proxy anymore).
The proxy will close connections when they are closed by either the 
client or the server.

Things to consider:
*) Does the proxy allow you to tunnel data to the ports you want? Since 
connect
can be used to connect to all ports, many proxies will only allow 
connects to some ports (like
443 for https).


/robo

Received on Saturday, 26 April 2003 17:22:54 UTC