Created
August 7, 2013 01:07
-
-
Save amccloud/6170361 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gevent import pywsgi | |
from geventwebsocket.handler import WebSocketHandler | |
def hello_world(environ, start_response): | |
ws = environ['wsgi.websocket'] | |
while ws.socket: | |
print ws.receive() | |
ws.close() | |
server = pywsgi.WSGIServer(('', 8090), hello_world, handler_class=WebSocketHandler) | |
server.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment