I've been using http://websocketstest.com/ to see blocking of my socket.io websockets. I just now came across a scenario too where a client had a firewall blocking traffic on port 80. Rather than insisting on them jumping through hoops I am now listen on 443, not necessary to use SSL either on that port for this purpose.
In nginx I am first redirecting all traffic to socket.test.com port 80 to port 443 thus:
server {
listen 80;
server_name socket.test.com;
rewrite ^ http://test.com:443$request_uri?;
}
then
server {
listen 443;
server_name socket.test.com
location / {
proxy_pass http://127.0.0.1:3004;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
On port 3004 a socket.io server is accepting connections. Works!
2018 update: thanks to letsencrypt.com it's now trivial to add https certs so all this can be done with encryption on 443