Hi, I've used gevent-websocket and gunicorn for this -- so in the gunicorn
config you use a GeventWebSocketWorker:
```
$ grep worker_class webapp/gconfig.py
worker_class = 'geventwebsocket.gunicorn.workers.GeventWebSocketWorker'
$ cat webapp/run.sh
#!/bin/bash
pushd $(dirname $0) > /dev/null
HERE="$(pwd)"
popd > /dev/null
exec gunicorn -c $HERE/gconfig.py $* main:app
```
Then in flask you define a route and a handler:
```
from flask import request, Flask
app = Flask(__name__)
def handler():
ws = request.environ['wsgi.websocket']
while 1:
msg = ws.receive()
ws.send(msg)
app.route('/ws/')(handler)
```
More or less -- code I mocked here is untested...
m
> --
> You received this message because you are subscribed to the Google Groups
> "gevent: coroutine-based Python network library" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to
gevent+un...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/
> gevent/975bcabc-dc59-4b12-95cb-3795ff6e39a0%
40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
--
Matt Billenstein
ma...@vazor.com
http://www.vazor.com/