Page MenuHomePhabricator

uwsgi with websockets on Toolforge
Closed, ResolvedPublic

Description

I'm trying to setup a websocket server with the uwsgi-plain gridengine backend and python3. I get the example on https://uwsgi-docs.readthedocs.io/en/latest/WebSockets.html to work on my local machine, but on Toolforge I get

[strict-mode] unknown config directive: http-websockets

when adding the directive to my uwsgi.ini and running webservice --backend=gridengine uwsgi-plain start. Websockets was added to uwsgi 1.9, and the uwsgi version that comes with debian stretch is 2.0.14+20161117-3+deb9u2, so it should be new enough. Btw., http-raw-body is also not enabled:

[strict-mode] unknown config directive: http-raw-body

Event Timeline

The uwsgi documentation is rather confusing, but I got it working without the --http-websockets flag, so I'm closing this issue for now. If anyone else is interesed, my uwsgi.ini is here: https://github.com/danmichaelo/UKBot/blob/master/uwsgi.ini

My initial plan was to use asyncio for handling concurrency, but uwsgi doesn't ship with it built-in by default yet (support is marked as "experimental"). Support for gevent seems to be better, but I would prefer not to write code tied to gevent, so, I'm sticking with good ol' processes and threads for now. With the uWSGI auto-scaling, it's not that bad.