nginx + python + websockets -
how can configure nginx (latest version, supports websockets) support websockets.
and how can use python run websockets connection.
that want:
- client creates websocket javascript;
- websocket server script runs on python;
- and nginx in backend of of this.
can body me?
i took quick @ relevant changeset nginx, , looks need start handling websocket requests set proxy in nginx config. example:
upstream pythonserver { server localhost:5000; } server { // normal server config stuff... location /some/uri/here { // minimum required settings proxy websocket connections proxy_pass http://pythonserver; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection "upgrade"; // other settings location } }
this little configuration snippet proxy incoming websocket traffic python application server, assumed in example listening local connections on port 5000.
hope helps.
Comments
Post a Comment