Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Renamed the ws4py server so to differentiate it from the twisted version

  • Loading branch information...
commit bd09e926554afc5b27e1aa596c03d130fc78d50d 1 parent 6952ca3
Eric Moritz authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 competition/wsdemo-ws4py.py
16 competition/wsdemo-ws4py.py
View
@@ -0,0 +1,16 @@
+from ws4py.server.geventserver import WebSocketServer
+from ws4py.websocket import WebSocket
+import gevent
+import time
+
+
+class EchoServer(WebSocket):
+ def received_message(self, message):
+ self.send(message.data, message.is_binary)
+
+
+if __name__ == '__main__':
+ server = WebSocketServer(('', 8000),
+ websocket_class=EchoServer)
+ print "listening on port 8000"
+ server.serve_forever()
Please sign in to comment.
Something went wrong with that request. Please try again.