Websocket handshake failing in Webkit with Socket.io 0.7
I have upgraded my node.js app to work with the latest socket.io module. However, now only Firefox can connect, Chrome and Safari give this error: Error during WebSocket h开发者_如何转开发andshake: 'Connection' header value is not 'Upgrade'
Nginx is not compatible (out of the box) with HTTP 1.1, which is required for WebSockets. You will need to patch it (something I couldn't help you with, too much trouble) or you could use a node.js only stack.
I use node-http-proxy.
See also: Advantages of a reverse proxy in front of Node.JS
Yep, it's totally nginx - I had everything working fine, changed some nonessential stuff and then it wouldn't work. It's only after reading this that I realised that I'd stopped entering the port in the URL and thus was falling under nginx's proxying. Added the port, worked immediately.
Check your Nginx version. v1.4 seems to work fine, whereas I had trouble with v1.2 (and had to upgrade).
精彩评论