Hacker News new | ask | show | jobs
by SwellJoe 5548 days ago
For what it's worth, proxying HTTP/1.1 is tremendously complex, and WebSockets are an interesting and somewhat intimidating pile of additional trouble. It's been years since I've worked on a proxy (I was a Squid developer many years ago), but since my current project will be dealing with WebSockets, it triggered an instant "I wonder how that's going to work through proxies" response, and an ingrained moment of my heart skipping a beat thinking about how complex such an implementation might become...so I went digging, and found this great thread on the Squid list:

http://www.squid-cache.org/mail-archive/squid-dev/200907/003...

If you want to skim, the really knowledgeable parties in the discussion are Henrik Nordstrom, Robert Collins, Alex Rousskov, Mark Nottingham, and Ian Hickson.

It's actually not as bad as I'd feared, but the protocol also obviously had many issues unresolved back then (and probably still, since security concerns led to it being disabled in Firefox 4 and Opera), as did the plausibility of implementing a proxy or a proxy cache that could support it.

But, to get back to nginx, it is also possible to selectively support 1.1 features without supporting the entire protocol. Squid has supported persistent connections for over a decade, but took years to get support for caching with ETag, ranges, and a number of MUST features, so it reported as HTTP/1.0 with additional capabilities (it might still do this, I haven't paid much attention since leaving the project). So, it seems plausible that someone could implement just the necessary features for WebSockets, without having to implement everything in HTTP/1.1.

1 comments

Interesting thread. Yes nginx already selectively supports 1.1 features but not everything. And yes I think the current security issues are the same ones, so maybe this will never have to be solved by proxies in this form, I havent seen what the current proposals to fix the websocket issues are...