Subject: [hybi] 04 and squid

From: Andy Green <[email-masked]>
Date: Fri, 28 Jan 2011 08:56:34 +0000

Hi -

At the suggestion of a guy offlist who was curious if 04 would actually 
work through proxies, I added http_proxy support (via CONNECT as per the 
standard) to libwebsockets last night and tested it with squid on a 
current Fedora rawhide box.

It worked fine, with a caveat.

Here are the steps to reproduce

  - libwebsockets 9659f379672d7be6
  - squid 3.1.10

  1) install squid on boxA

  2) edit default squid config

   acl SSL_ports port 443

    to

   acl SSL_ports port 443 7681 80

   (7681 is default libwebsocket test port 80 is obvious)

  3) restart squid

  4) On boxB, run

   libwebsockets-test-server --port 80

  5) On boxA, run

   http_proxy=boxA:3128 libwebsockets-test-client boxB --port 80

Running both client and server on 7681 was also fine; adding --ssl flag 
to client and server also worked fine through the proxy.

However, out of the box, the squid config disallows use of CONNECT 
except on SSL_ports, which defaults to 443.  So by default ws:// will 
fail through these guys, but wss:// on 443 will succeed.

I don't think it makes any overall big trouble but just a datapoint.

-Andy