» Load balance WebSocket connections to Tornado app using HAProxy?
Load balance WebSocket connections to Tornado app using HAProxy?
|June 5, 2012
Posted by forumadmin
I am working on a Tornado app that uses websocket handlers. I’m running multiple instances of the app using Supervisord, but I have trouble load balancing websocket connections.
I know nginx does not support dealing with websockets out of the box, but I followed the instructions here http://www.letseehere.com/reverse-proxy-web-sockets to use the nginx tcp_proxy module to reverse proxy websocket connections. However, this did not work since the module can’t route websocket urls (ex: ws://localhost:80/something). So it would not work with the URL routes I have defined in my Tornado app.
From my research around the web, it seems that HAProxy is the way to go to load balance my websocket connections. However, I’m having trouble finding any decent guidance to setup HAProxy to load balance websocket connections and also be able to handle websocket URL routes.
I would really appreciate some detailed directions on how to get this going. I am also fully open to other solutions as well.
Thank you in advance.
More Related Questions
- nginx, node.js and socket.io – is there a working marriage? nginx is a killer static file server.
it can serve node.js, as in this example, but in a limited fashion.
but nginx is apparently unable to proxy websockets.
the only thing I found that […]
- nginx 1.2.0 – socket.io – HTTP/1.1 – Proxy websocket connections i would like to replace my node-http-proxy module with nginx proxy_pass module. Is it possible with new released nginx version, as i have read, that it supports HTTP/1.1 out of the box. I […]
- Programmatically add nodes to a load balancer like Haproxy? I'm very sure this problem has been solved, but I can't find any information anywhere about it...
How do sysadmins programmatically add a new node to an existing and running load balancer […]
- Handling OPTIONS request in nginx We're using HAProxy as a load balancer at the moment, and it regularly makes requests to the downstream boxes to make sure they're alive using an OPTIONS request:
OPTIONS /index.html […]
- Load balancing PHP web application with three servers I have 2 web servers and 1 server that is intended to be used as reverse proxy or load balancer. 2 web servers have real/public IPs as well as the load balancer. Load balancer server is […]
- Can nginx be used as a reverse proxy for a backend websocket server? We're working on a Ruby on Rails app that needs to take advantage of html5 websockets. At the moment, we have two separate "servers" so to speak: our main app running on nginx+passenger, […]
- websocket request header miss upgrade I use tornado develop a websocket server, and I use nginx delegate the python server, the nginx config a server_name, and my server in Chian, and I connect the websocket server from China, […]
- Node.JS, HAproxy and Socket.IO through NGINX, app sits in subdirectory I've been trying for hours and have read what this site and the internet have to offer. I just can't quite seem to get Socket.IO to work properly here. I know nginx by default can't handle […]
- Nginx as Reverse Proxy – Double Proxy Pass ? is this possible? I have common problem anyone can encounter when you run nginx as a reverse proxy server for apache, i want to add double proxy_pass variables to the nginx conf. file but this doesn't seems […]
- How do I configure Tomcat and HAProxy to work with the WebSocket Framework Atmosphere? I have a Java application running on Tomcat7, which uses the Atmosphere Framework. Atmosphere is a Websocket Framework. I used a sample application from the Atmosphere Sample Chat.