Subject: Sending Connect request

From: rajev samyal <[email-masked]>
Date: Sat, 26 Apr 2003 07:54:52 -0400 (EDT)

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 isStep 1: Send a http request to the proxy with only CONNECT method i.e. the header will only contain connect method and nothing elseStep 2 : Receive the response from the serverStep 3: Send the Get request to the server, containing other fields as host, Accept etcStep 4: Receive the response from the server Is my thinking correct. Can you suggest me something on the same. Regards,Rajeev     

---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.

---

From: Robert Olofsson <[email-masked]>
Date: Sat, 26 Apr 2003 23:22:42 +0200

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

---

From: Scott Lawrence <[email-masked]>
Date: 26 Apr 2003 23:18:32 -0400

rajev samyal <[email-masked]> writes:

> 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. 

See RFC 2817
  http://www.ietf.org/rfc/rfc2817.txt

-- 
Scott Lawrence        
  Actively seeking work 
  http://skrb.org/scott/
  [ <[email-masked]> is deprecated ]

---

From: Dave Kristol <[email-masked]>
Date: Sun, 27 Apr 2003 22:35:12 -0400 (EDT)

>   http://www.ietf.org/rfc/rfc2817.txt

Have I missed something?  Are the answers that propose CONNECT 
over-thinking the question?

To connect to an HTTP application through a proxy, send an absolute URI
(RFC 2616) to the proxy.  For example, if the application server is 
app.com and the proxy server is proxy.com, send this request to proxy.com:

GET http://app.com/the-rest-of-the-URI HTTP/1.1
Host: app.com
[more headers]
...

Dave Kristol

---

From: Scott Lawrence <[email-masked]>
Date: 28 Apr 2003 07:17:55 -0400

Dave Kristol <[email-masked]> writes:

> (RFC 2616) to the proxy.  For example, if the application server is app.com
> 
> and the proxy server is proxy.com, send this request to proxy.com:
> 

I'm assuming his idea was to tunnel and use the connection for
something else... but you may be right.