Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Websocket Adjustments #955
Two principal changes:
A long message is given if the connection fails within 1s, which assumes the connection did not succeed. Otherwise, it is a short 'connection closed unexpectedly'.
This also means that clients are notified on server termination (for better or worse).
This made the notebook server artificially and unnecessarily brittle against tunneling and explicit hostname resolution. Now, the ws_url is defined based on the Origin of the request for the url, so it always matches the http[s] url. This means that it will follow the same tunnel, and the hostname will be already resolved. Resolving the hostname twice makes no sense at all unless the websockets are going to a different server than the http requests.
Implemented as a property, so it should still be easy to change for future cases where it might behave differently (e.g. websockets on a different host, or at a non-root url).
This is one approach to closing #952, but there might be better ways to do it (e.g. dialogs that are not base
Mh, I tried running a notebook with this branch on and I got this traceback:
I can't actually execute any cells. Do you get the same? Note that the traceback occurs on notebook connection, before any attempt to even execute code.
Apparently Firefox doesn't send the Origin header, so I changed it to write protocol / host directly from the request. This will still work for tunnels, but I think it probably won't work if the notebook server is behind a reverse-proxy (e.g. if you have apache set up to forward