Permalink
Browse files

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

  • Loading branch information...
1 parent 6952ca3 commit bd09e926554afc5b27e1aa596c03d130fc78d50d @ericmoritz committed Jun 13, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 competition/wsdemo-ws4py.py
@@ -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()

0 comments on commit bd09e92

Please sign in to comment.