Skip to content

Commit

Permalink
Updated example app to use gevent websocket if available
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Aug 20, 2015
1 parent e120342 commit 7b2e4ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 10 additions & 1 deletion example/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ def test_disconnect(sid):
elif async_mode == 'gevent':
# deploy with gevent
from gevent import pywsgi
pywsgi.WSGIServer(('', 5000), app).serve_forever()
try:
from geventwebsocket.handler import WebSocketHandler
websocket = True
except ImportError:
websocket = False
if websocket:
pywsgi.WSGIServer(('', 5000), app,
handler_class=WebSocketHandler).serve_forever()
else:
pywsgi.WSGIServer(('', 5000), app).serve_forever()
else:
print('Unknown async_mode: ' + async_mode)
2 changes: 0 additions & 2 deletions example/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
eventlet==0.17.4
greenlet==0.4.7
python-engineio==0.1.0
six==1.9.0

0 comments on commit 7b2e4ab

Please sign in to comment.