Hi all microwhiskeyers, I am building a website which is running on Pyramid framework. Currently the stack runs on Nginx and uWSGI. I am now exploring the option of adding a websocket support for some particular features.
I am reading the websocket documentation here http://uwsgi-docs.readthedocs.org/en/latest/WebSockets.html and my question is the following. I have cookie-based Pyramid authentication and I'd like to authenticate the users before letting the websocket connection to proceed. - WebSocket connection must be upgraded through Upgrade: websocket HTTP request header - How can I write such a WSGI response / Pyramid view which which will tell uWSGI to a) Upgrade to the websocket connection b) Start (asynchronous?) event loop and let the Websocket message handing take over Especially the b) part is still open question what comes to mixing in traditional WSGI with websockets. All examples I found are "websocket only" applications and do not seem to concern with old fashioned HTTP views. Or is this even possible and do I need to route all "websocket-like" HTTP requests to the websocket WSGI application in the first place. For me the scalability and performance is not an issue, but making the implementation as simple as possible. So using things like threads is ok, it doesn't have to be super asynchronous. Also using Python 3. Thank you for the replies. -- Mikko Ohtamaa http://opensourcehacker.com http://twitter.com/moo9000
_______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
