First version of working websocket protocol.

This commit is contained in:
Griatch 2014-04-13 16:26:14 +02:00
parent 01d15f13ee
commit ef0a154a61
5 changed files with 53 additions and 36 deletions

View file

@ -285,10 +285,10 @@ if WEBSOCKET_ENABLED:
ifacestr = "-%s" % interface
for port in WEBSOCKET_PORTS:
pstring = "%s:%s" % (ifacestr, port)
factory = WebSocketFactory(protocol.ServerFactory())
factory = protocol.ServerFactory()
factory.protocol = websocket.WebSocketProtocol
factory.sessionhandler = PORTAL_SESSIONS
websocket_service = internet.TCPServer(port, factory, interface=interface)
websocket_service = internet.TCPServer(port, WebSocketFactory(factory), interface=interface)
websocket_service.setName('EvenniaWebSocket%s' % pstring)
PORTAL.services.addService(websocket_service)