3

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 handshake: 'Connection' header value is not 'Upgrade'

5
  • 1
    Which versions of Chrome / Safari. Also try complaining in #socket.io Commented Jul 4, 2011 at 22:21
  • Google Chrome 12.0.742.112 / Safari 5.0.5 (6533.21.1) Commented Jul 5, 2011 at 21:16
  • I am also experiencing this problem, using node 0.4.5 and socket.io 0.7.6 on dotcloud. Commented Jul 6, 2011 at 20:58
  • Temporary solution is to disable native websockets and use xhr-polling instead. I asked in #socket.io, nobody seems to know whats up, its not a common problem. I get the problem even with the hello world example app. Commented Jul 7, 2011 at 13:47
  • I have the same problem on Heroku, but they are using Nginx and state that they only support HTTP 1.0 (devcenter.heroku.com/articles/http-routing) Commented Nov 6, 2011 at 2:27

3 Answers 3

3

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

Sign up to request clarification or add additional context in comments.

1 Comment

The development version of Nginx supports HTTP 1.1, so that's another option. :)
1

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.

Comments

0

Check your Nginx version. v1.4 seems to work fine, whereas I had trouble with v1.2 (and had to upgrade).

1 Comment

FYI, if upgrading to 1.4 on Ubuntu, this is the resource you need: slashgeek.net/2013/05/08/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.