On Sat, Feb 05, 2011 at 03:43:38PM +0100, Jan-Frode Myklebust wrote:
> On Fri, Feb 4, 2011 at 9:37 PM, Willy Tarreau <[email protected]> wrote:
> > Hi Jan-Frode,
> >
> > On Fri, Feb 04, 2011 at 03:15:49PM +0100, Jan-Frode Myklebust wrote:
> >> We're trying to filter out HTTP HEAD requests using haproxy,
> >> to make the proxy behave like shoutcast servers, ref:
> >>
> >>       http://comments.gmane.org/gmane.comp.web.haproxy/2961
> >
> > But why the hell are your trying to deliberately break HTTP ?
> 
> Because that´s what shoutcast seems to be -- HTTP/0.9 with some custom
> ICY-headers.

But what you showed were HTTP/1.0 requests. HTTP/1.0 and 0.9 are very
different :
  - HTTP/0.9 has no HTTP version on the request line
  - HTTP/0.9 has no header, thus no empty line.

If there is a version on the line, it's HTTP/1.x. Every subsequent line is a
header line and the request only ends at the empty line.

Haproxy supports HTTP/0.9 requests. So it will not wait for an empty
line. You can try it if you want. However as most products, it upgrades
them as 1.0 when forwarding them.

> > It might be a lot better for the long term to fix the server
> > instead, or you'll constantly have to resort to dirty tricks
> > to achieve that.
> 
> Unfortunately I don´t control the servers (or protocol). I have lots
> of STBs on private networks (rc1918), no NAT, and need to give them
> access to various shoutcast servers on the Internet. But I guess I´ll
> need to find some other solution.. look into shoutcast proxy servers,
> or see if we can configure the clients to use squid + the
> upgrade_http09 option.
> 
> http://www.squid-cache.org/Doc/config/upgrade_http0.9/

What's said there is interesting because apparently it's used to prevent
upgrade on the response path, but it apparently still upgrades the request.

> > From RFC2616 par.5.1.2:
> >
> >   The methods GET and HEAD MUST be supported by all general-purpose
> >   servers. All other methods are OPTIONAL.
> 
> Wrong RFC in this case.. :-)
> 
>    http://www.w3.org/Protocols/HTTP/AsImplemented.html

But that's not the example you sent either ;-)

See what setup you manage to get to work, especially if the servers
accept HTTP/1.0. If so, maybe we can try to downgrade the response to
HTTP/0.9 (which simply consists in stripping headers).

Regards,
Willy


Reply via email to