[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: transparent proxy
On Wed, 4 Nov 1998, Ira Abramov wrote:
> nope. an http 1.X requst doesn't HAVE to include the full URL (including
> hostname) but in fact it always will include it for the very simple reason
> that that is the simplest way to create multiple virtual websites on one
> machine without eating up IP addresses. simply telnet to
> third.floor.palo-alto.ca.us port 80 and try the many web sites we run
> there on a single IP address:
>
> GET http://www.scso.com/ HTTP/1.0
actually, this practice is used ONLY if you tell lynx (or any browser) to
work with a proxy server. if it thinks it is sending requests directly to
the web server, it uses URLS without the protocol, host and port parts.
the way that the web server distinguishes the different URLs is by using
the 'Host:' header that the client (lynx or whatever) inserts as part of
the data it sends, as per HTTP 1.1 specs. you can verify this by reading
the specs, as well as by configuring lynx NOT to use a proxy, and then
tracing it. i did that with v2.7.1 (as well as v2.6) and it indeed only
sent the full "file path" in the 'GET' request. also, for some reason,
the 2.7.1 version still emits 'HTTP/1.0' as the protocol, instead of
'HTTP/1.1'. i think this was done to assure compatibility with older web
servers.
can you do such a tracing with lynx 2.8 and check if they changed the
behaviour there?
so, to conclude: port redirection seems not to be enough. what you
probably need is one of two things:
1. write a port redirector that also translates the firse line of the
request being sent by checking the 'Host' header, and
pre-pending that to the rest of the URL in the 'Get' header.
or
2. add this feature to squid, or check if it perhaps already supports this
feature... try asking on squid's mailing list.
guy