tornado: Store port on SockJS connection object.

This will make it available for use inside our websockets code.
This commit is contained in:
Tim Abbott
2018-11-02 16:09:16 -07:00
parent 5e7aa27c29
commit ec065e92ee
4 changed files with 7 additions and 6 deletions

View File

@@ -275,5 +275,6 @@ sockjs_url = '%s/static/third/sockjs/sockjs-0.3.4.js' % (settings.ROOT_DOMAIN_UR
sockjs_router = sockjs.tornado.SockJSRouter(SocketConnection, "/sockjs",
{'sockjs_url': sockjs_url,
'disabled_transports': ['eventsource', 'htmlfile']})
def get_sockjs_router() -> sockjs.tornado.SockJSRouter:
def get_sockjs_router(port: int) -> sockjs.tornado.SockJSRouter:
sockjs_router._connection.port = port
return sockjs_router