Incorporated suggestions from Paul Kienzle, Josh VanderLinden, Ian Fitzpatrick
This commit is contained in:
parent
7d68382340
commit
672b2fc679
9 changed files with 525 additions and 97 deletions
29
serve_tests.py
Executable file
29
serve_tests.py
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
'Launch this server in another terminal window before running tests'
|
||||
from socketio import socketio_manage
|
||||
from socketio.namespace import BaseNamespace
|
||||
from socketio.server import SocketIOServer
|
||||
|
||||
|
||||
class Namespace(BaseNamespace):
|
||||
|
||||
def on_aaa(self, *args):
|
||||
self.socket.send_packet(dict(
|
||||
type='event',
|
||||
name='ddd',
|
||||
args=args,
|
||||
endpoint=self.ns_name))
|
||||
|
||||
|
||||
class Application(object):
|
||||
|
||||
def __call__(self, environ, start_response):
|
||||
socketio_manage(environ, {
|
||||
'': Namespace,
|
||||
'/chat': Namespace,
|
||||
'/news': Namespace,
|
||||
})
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
socketIOServer = SocketIOServer(('0.0.0.0', 8000), Application())
|
||||
socketIOServer.serve_forever()
|
||||
Loading…
Add table
Add a link
Reference in a new issue