see
https://github.com/abourget/gevent-socketio/issues/167Without proxy everything work
With ngninx proxy or ha proxy gevent-socketio dosen't work
Tested with simple_chat and cpu_graph app.
when i start the
live_cpu_graph
on firebug i see the ugrade socket, i see also on the terminal the socket request
But no answer from the socketio_manage(environ, {'': ChatNamespace}, self.request)
Nothing special on the haproxy & nginx proxy log
gevent-socketio : version 0.3.6
nginx : version 1.5.6
HA-Proxy: version 1.4.18 2011/09/16
configuration with nginx proxy
upstream app_graph {
server localhost:8090;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
root /home/dev/live_cpu_graph/live_cpu_graph;
index index.html index.htm;
server_name _;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://app_graph/;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}
HA config
global
maxconn 4096
daemon
defaults
mode http
log 127.0.0.1 local1 debug
option httplog
frontend all 0.0.0.0:80
timeout client 86400000
default_backend www_backend
acl is_websocket hdr(Upgrade) -i WebSocket
acl is_websocket path_beg /socket.io/
use_backend socket_backend if is_websocket
backend www_backend
balance roundrobin
option forwardfor # This sets X-Forwarded-For
option httpclose
timeout server 30000
timeout connect 4000
server server1 localhost:81 weight 1 maxconn 1024 check
backend socket_backend
balance roundrobin
option forwardfor # This sets X-Forwarded-For
option httpclose
timeout queue 5000
timeout server 86400000
timeout connect 86400000
server server1 localhost:8090 weight 1 maxconn 1024 check
HAproxy nginx conf
server {
listen 81;
server_name myapp.example.com;
root /home/icham/dev/live_cpu_graph/live_cpu_graph;
index index.html index.htm chat.html;
server_name _;
}