Re: [squid-users] Proxy Specs

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Tue, 29 May 2007 21:55:16 +0200

tis 2007-05-29 klockan 21:31 +0200 skrev The Nux:
> Hi there,
> I am coding a proxy (not something big, I just need it for a project)
> in Java, then I would have some questions about proxies :
>
> * Why does HTTP/FTP/SSL & co proxies exist since SOCKS alone could
> do all needed tasks ?

Squid is a HTTP proxy. All communication to Squid is HTTP. But HTTP
proxies can resolve a number of different URL-schemes for their HTTP
clients..

The difference between an HTTP proxy and SOCKS is that the HTTP proxy is
fully aware of the protocol being proxied, and as result have well
defined behavior. The main difference is the ability to cache results.

SOCKS on the other hand is protocol neutral and SHOULD NOT perform
caching or other heavily protocol dependent actions.

> * Can I force firefox (or anything else) that support both HTTP and
> SOCKS to use SOCKS for seeing web pages ?

Sure. Just set the SOCKS proxy field in the proxy settings instead of
the HTTP proxy, or use a proxy.pac script returning the desired SOCKS
proxy details. With the proxy.pac method you can select in detail when
to use what kind of proxy.. (HTTP or SOCKS or DIRECT).

> * Where can I find specs for doing HTTP/FTP/SSL/Gopher proxy ?

HTTP proxies acts as gateways for the other schemes, with the exception
of SSL which is tunneled using the CONNECT method. CONNECT is defined in
RFC2817.

The details regarding ftp and gopher can be found in RFC1738 where the
ftp:// and gopher:// URI schemes is defined.
 
The general stuff regarding HTTP proxying is in RFC2616.

> * How comes that all proxy services are listening on the same port ?
> Does the proxy server bind to specific protocol proxy according to
> what headers looks like ?

A HTTP proxy only talks HTTP to it's clients regardless of which
URI-scheme the client requests.

An HTTP proxy request for an HTTP object looks like

GET http://server/path HTTP/1.1
Host: server
[other headers]

And for an FTP object

GET ftp://server/path HTTP/1.1.
Host: server
[other headers]

and it's the proxy responsibility to figure out how to get the requested
resource and map it to an HTTP response to the client.

You are welcome to ask HTTP protocol or code questions on
squid-dev@squid-cache.org

Regards
Henrik

Received on Tue May 29 2007 - 13:55:22 MDT

This archive was generated by hypermail pre-2.1.9 : Fri Jun 01 2007 - 12:00:05 MDT