proxying non HTTP protocols through HTTP

Hi,

I have been working on an HTTP proxy that using different 
techniques can improve the transmission ratios over slow lines 
for web traffic. Now I want to do the same for other protocols 
like IMAP, SMTP or NNTP but I have found that there is not any 
standard defining how to proxy them.

Well, there is SOCKS 4/5 but it is not an application layer 
proxy. SOCKS allows to forward TCP and UDP connections but there 
is not any way to know which protocols are being talked over the 
connections unless some heuristics are applied, and heuristics 
can fail.

Looking at HTTP, the CONNECT method also allows for proxying any 
protocol but it has the same problem that SOCKS: there is not 
information about which protocol is being used. The difference is 
that headers can be used for that.

So my intention with this mail is to start a discussion about how 
to extend HTTP to support proxying at the application layer of 
non-HTTP protocols in this way:

   1- connect to proxy
   2- use HTTP to request a new connection talking protocol P
   3- switch to protocol P
   4- talk P
   5- close connection

The important point and the one that needs to be defined is 2, 
how to tell the proxy whith protocol to use. I have some ideas 
about that and I hope I will be able to expose them better with 
some example HTTP requests:


1) Using "CONNECT" and "Upgrade" header:

   CONNECT my.imap.server.com HTTP/1.1
   Upgrade: IMAP
   Connection: Upgrade


2) Using "CONNECT" with new header (i.e. "New-Protocol")

   CONNECT my.imap.server.com HTTP/1.1
   New-Protocol: IMAP


3) add a new HTTP method for proxying:

   PROXY imap:my.imap.server.com HTTP/1.1


4) Adding protocol specification to host:

   CONNECT imap:my.imap.server.com HTTP/1.1


BTW, my preferred option is the first one that reuses elements 
already existent on the HTTP protocol.

Other point needing consideration is what happens when several 
proxies are chained. "Upgrade" is a one hop header.



I am awaiting your comments,

Best Regards,

   - Salvador Fandiņo.

Received on Thursday, 5 June 2003 09:42:22 UTC