[IPython-dev] IPython Notebook on Webfaction

Jason Grout jason-sage@creativetrax....
Mon Sep 24 11:31:08 CDT 2012


On 9/24/12 11:19 AM, T J wrote:
> On Sat, Sep 22, 2012 at 1:54 PM, T J <tjhnson@gmail.com
> <mailto:tjhnson@gmail.com>> wrote:
>
>     On Thu, Sep 20, 2012 at 2:42 PM, MinRK <benjaminrk@gmail.com
>     <mailto:benjaminrk@gmail.com>> wrote:
>
>
>
>         On Wed, Sep 19, 2012 at 9:32 AM, T J <tjhnson@gmail.com
>         <mailto:tjhnson@gmail.com>> wrote:
>
>             On Wed, Sep 19, 2012 at 4:49 AM, Thomas Kluyver
>             <takowl@gmail.com <mailto:takowl@gmail.com>> wrote:
>
>                 On 19 September 2012 08:49, T J <tjhnson@gmail.com
>                 <mailto:tjhnson@gmail.com>> wrote:
>                  > the last response from the OP mentions that each open
>                 notebook uses 3 random
>                  > ports (which differ from the port that the IPython
>                 notebook server listens
>                  > on).  Is this true?  This seems like it would be an
>                 issue for me.  Can
>                  > someone explain, in general, what IPython notebook is
>                 doing with these other
>                  > ports?
>
>                 One of them is the main request/response channel (e.g.
>                 'execute this
>                 code', 'get completions for foo'), one is a publication
>                 channel,
>                 primarily for things printed to stdout, and I think the
>                 third is to
>                 get input for stdin (although the notebook doesn't
>                 currently implement
>                 that).
>
>                 There's a pull request open that experiments with
>                 merging the three
>                 websocket channels into one - that might help you:
>                 https://github.com/ipython/ipython/pull/2321
>
>
>
>             Look promising.  This pull requests seems to make it easier
>             to use the notebook behind a proxy, but its unclear to me if
>             this allows me to restrict which the ports the notebooks
>             will try to use.
>
>
>         People get confused by the fact that the notebook communicates
>         with *kernels* via random localhost ports (even there, it
>         connects, it does not listen).  All communications with browsers
>         happen over a single port, and the notebook server only ever
>         listens on that single user-configurable port.
>
>
>
>     Thanks for the clarification. Very helpful.
>
>
> I've given this another try now (still behind the Webfaction proxy),
> using pull request #2321, but I'm still getting "404: Not Found".  In
> order to use SockJS, must I do any configuration or should it have been
> automatic?

I haven't noticed #2321 before.  Just FYI, we use SockJS in the Sage 
Cell server to communicate with an IPython kernel.  Quick links to our code:

javascript:

https://github.com/sagemath/sagecell/blob/master/static/compute_server.js#L85

https://github.com/sagemath/sagecell/blob/master/static/compute_server.js#L989

server:
https://github.com/sagemath/sagecell/blob/master/handlers.py#L105

Thanks,

Jason



More information about the IPython-dev mailing list