[IPython-dev] Notebook websocket change

William Stein wstein at gmail.com
Thu Jan 8 13:10:10 EST 2015

On Thu, Jan 8, 2015 at 10:04 AM, MinRK <benjaminrk at gmail.com> wrote:
> Alternative notebook frontend authors:
> There is an upcoming change to websocket connections to the notebook server.
> Instead of three websockets per notebook, one for each zmq channel, there is
> a single websocket connection between the server and client. The channel
> associated with each message is identified by a channel key in the message
> dict itself.
> Relevant changes:
> url is /channels instead of /shell, etc.
> when sending a message, add a channel key with the channel name ('shell',
> 'stdin')
> when receiving a message, check the channel key for routing
> -MinRK


Of related interest, what the situation involving providing a fallback
to websockets?

I tried to only support websockets connections with SageMathCloud for
a few weeks, and immediately ran into many complaints from users who
couldn't connect as a result.   This is even with https and so on --
it's just a sad fact that in some corporate or otherwise constrained
environments that websockets don't work.   By far the best approach I
found was to use Primus + Engine.io, which uses websockets if
possible, but will fallback to polling.   So this is what SMC does
now, and everything works, even for people that don't have websockets
as an option... except for IPython-in-SMC of course, which doesn't

Another unrelated issue is that I'm now hardcoding making this change
around line 171 of IPython/html/notebookapp.py, since I want to serve
the purely static html of IPython from a completely different web

            #static_url_prefix = url_path_join(base_url,'/static/'),
            static_url_prefix = '/static/ipython/',

(Sorry for derailing the thread.)

 -- William

> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

William Stein
Professor of Mathematics
University of Washington

More information about the IPython-dev mailing list