[Web-SIG] websocket support in WSGI

Sylvain Hellegouarch sh at defuze.org
Tue May 22 09:38:18 CEST 2012


>
>
> In other words: The responsibility for the connection (and socket) is
> passed to the application.
>
> This works well with traditional threaded servers. The application can
> spawn a new worker thread, put the job into a queue or whatever and then
> return from the application callable, allowing the server thread to
> continue handling new connections.
>
>
This is exactly how ws4py was implemented when using CherryPy for the HTTP
server performing the handshake [1]. There's also a WSGI middleware [2] but
it's heavily geared towards gevent and may not be reusable easily elsewhere
I'm afraid.

-- 
- Sylvain
http://www.defuze.org
http://twitter.com/lawouach

[1]
https://github.com/Lawouach/WebSocket-for-Python/blob/master/ws4py/server/cherrypyserver.py
[2]
https://github.com/Lawouach/WebSocket-for-Python/blob/master/ws4py/server/wsgi/middleware.py
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/web-sig/attachments/20120522/bafacf1d/attachment.html>


More information about the Web-SIG mailing list