6

I'm currently having a lots of difficulties trying to play with socket.io which needs websockets support from the server (reverse-proxying).

I was wondering, is there any other web servers out there that supports websockets?

The errors I'm having with nginx:

2012/05/22 02:19:34 [error] 28159#0: *5 connect() failed (111: Connection refused) while connecting to upstream, 
client: my.ip.ad.dr,
server: localhost,
request: "GET /socket.io/1/?t=1337653158192 HTTP/1.1", 
upstream: "http://127.0.0.1:3000/socket.io/1/?t=1337653158192", 
host: "lifestore.brainpad.org", referrer: "http://mywebad.dr/"
  • 2
    Websockets are not currently supported by Nginx (even though v1.2 implements HTTP/1.1) They are on the roadmap for Nginx 1.3. You may have some luck with the tcp-proxy-module or node-http-proxy. Personally, I place Varnish in front of Nginx and have it proxy Websocket requests directly to Node.js (HAProxy should also work). – cyberx86 May 22 '12 at 4:08
4

nginx doesn't natively support websockets. Looks like there is a tcp proxy module that can be compiled into nginx to do this.

http://www.letseehere.com/reverse-proxy-web-sockets

But a few other discussions(here and on SO) seem to indicate that one would go down to node.js directly.

Given that you're using socket.io, I suspect you're already using node.js on the backend. Also, this blog post by the trello team is rather informative. http://blog.fogcreek.com/the-trello-tech-stack/

  • Thanks! That post you have is very informative and gave me even more ideas for my project! – Tommy B. May 22 '12 at 11:50
2

nginx has support for proxying WebSockets since version 1.3.13.

The only thing I've found so far that could conceivably be called documentation is this commit message.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.