Converted webclient to use websockets on port 8001. Ideally one would make it so the ajax and websocket clients work under the same django wrapper, but for now this functionality is elusive.

This commit is contained in:
Griatch 2014-06-15 21:58:53 +02:00
parent 2a6cfaca7d
commit ede6634081
11 changed files with 326 additions and 37 deletions

View file

@ -262,6 +262,12 @@ if WEBSERVER_ENABLED:
web_root.putChild("webclientdata", webclient)
webclientstr = "/client"
#from src.server.portal import websocket
#factory = protocol.ServerFactory()
#websocketclient = websocket.WebSocketProtocol()
#websocketclient.sessionhandler = PORTAL_SESSIONS
#web_root.putChild("websocket", websocketclient)
web_root = server.Site(web_root, logPath=settings.HTTP_LOG_FILE)
proxy_service = internet.TCPServer(proxyport,
web_root,
@ -270,7 +276,6 @@ if WEBSERVER_ENABLED:
PORTAL.services.addService(proxy_service)
print " webproxy%s%s:%s (<-> %s)" % (webclientstr, ifacestr, proxyport, serverport)
if WEBSOCKET_ENABLED:
# websocket support is experimental!

View file

@ -37,6 +37,7 @@ class WebSocketProtocol(Protocol, Session):
"""
This is called when the connection is first established
"""
def connectionMade(self):
"""
This is called when the connection is first established.