[IPython-User] sockjs code test

Matthias BUSSONNIER bussonniermatthias@gmail....
Thu Nov 1 08:43:59 CDT 2012

Le 1 nov. 2012 à 12:49, Darren Govoni a écrit :

> Hi,
>    When I tried the sockjs branch, my goal was for it to address the issue with the main branch
> opening random sockets back to the server which is not a firewall or WAN friendly approach.
> I thought sockjs was coded to address this, but I also was not able to get it working and tried
> the various suggestions (e.g. setting disabled protocol="ws" etc) but it still wouldn't work across
> our network.
> I would offer again, that despite the convenience of using on-the-fly ports, the best and most 
> web-compliant approach is to tunnel all the client/server interactions over the same port/HTTP
> that the client originated and use the "front-controller" pattern on the server to sort out what
> goes where. This approach is proven to work and to scale. And its how ipcontroller sort of already
> works (as a hub controller for multiple engines and manages the interactions of those engines).

As MinRK said : 
> Also, websockets do not go over special ports, they go over the exact same port as the rest of the http[s] connection.
> -MinRK

Everything is multiplexed on the same TCP connexion, same port as usual along with http.
Then the server does "sort out what goes where".

the only port in use between browser and server is the one that appear in this line 
[NotebookApp] The IPython Notebook is running at: https://[all ip addresses on your system]:8888/

looking at js console, you can see that websoket use the same port (8888) :
Starting WS: wss://localhost:8888/kernels/bb353c4f-3cbe-499a-9f1f-e8d20f2292a3 

You can set it to 80 or 443 if you wish (--port option) but you need to be root.

Sock JS provide fallbacks if websocket does not go through, with long polling… etc.

The  "on-the-fly ports port" are to communicate between **server** and **kernels** they have nothing to do with browser frontend <-> server communication.
If there were any issues with those random port, user would not be able to have a working qtconsole or zmq console.


> Darren
> On 10/31/2012 11:23 PM, Massimo Di Stefano wrote:
>> Hi All,
>> i've exactly the same needs, 
>> the network of my institute is under a VPN & firewall 
>> and they don't allow me to run the notebook outside the VPN
>> looking for a solution i found the sockjs branch a possible way to figure out this problem 
>> i reinstalled ipython using the sokjs branch .. but i guess i need to tune-up some settings in order to have it running.
>> because i have exactly the same behavior of master branch.
>> please can you try to guide me to learn how to use that branch ?
>> thanks.
>> Massimo.
>> Il giorno Sep 19, 2012, alle ore 9:12 AM, Darren Govoni ha scritto:
>>> Hi,
>>>   I got the sockjs code PR from minrk git and wanted to try it from my Amazon instance within our network (which blocks non 80 outbound ports). I have configured my ipython notebook to run on port 80.
>>> When I access the notebook, I get this error in FF.
>>> --------------------------------------------------------------
>>> Kernel started: 
>>> 5c3becbf-c91b-4bed-927d-e2c67a2f01d3
>>> kernel.js?v=b53bb (line 80)
>>> Starting WS:
>>> ws://ec2-50-17-81-219.compute-1.amazonaws.com/kernels/5c3becbf-c91b-4bed-927d-e2c67a2f01d3
>>> kernel.js?v=b53bb (line 127)
>>> The connection to ws://ec2-50-17-81-219.compute-1.amazonaws.com/kernels/5c3becbf-c91b-4bed-927d-e2c67a2f01d3/shell was interrupted while the page was loading.
>>> this.shell_channel = new this.WebSocket(ws_url + "/shell");
>>> kernel.js?v=b53bb (line 128)
>>> The connection to ws://ec2-50-17-81-219.comput
>>>  e-1.amazonaws.com/kernels/5c3becbf-c91b-4bed-927d-e2c67a2f01d3/iopub was interrupted while the page was loading.
>>> this.iopub_channel = new this.WebSocket(ws_url + "/iopub");
>>>  -----------------------------------------------------
>>> My goal/desire is to have all the interactions from client notebook to server to route over friendly HTTP (not random ports) from the originating server (which is the secure approach). Is this possible or intended? Otherwise, we won't be able to use this wonderful tool. Tips appreciated.
>>> Darren
>>> _______________________________________________
>>> IPython-User mailing list
>>> IPython-User@scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-user
>> _______________________________________________
>> IPython-User mailing list
>> IPython-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-user
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20121101/6137a56e/attachment-0001.html 

More information about the IPython-User mailing list