Skip to content

Instantly share code, notes, and snippets.

@amccloud
Created August 7, 2013 01:07
Show Gist options
  • Save amccloud/6170361 to your computer and use it in GitHub Desktop.
Save amccloud/6170361 to your computer and use it in GitHub Desktop.
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