awb99 February 2016

Jupyter websocket issue

I have a debian Jupyter running on port 8888.

I want to make it easier to connect to my server,so I have a node.js app running that forwards request to jupyter.mydomain.com:80 to port 8888, andother domains to other ports.

This way I dont have to remember the ports of different apps, and instead can refer to the server with different dns names. All the different names are setup as a links in the dns server.

Now Jupyter works this way; but the Websockets that report the result of calculations do not due to security error.

Is there any setting how I can get this to work?

Regards

Andreas

Answers


minrk February 2016

node-http-proxy is a node proxy that supports websockets. Your node app that's proxying requests must also proxy websocket connections.

JupyterHub is a multi-user server for spawning and authenticating single-user notebook servers, and it uses configurable-http-proxy, a subclass of node-http-proxy that adds some live configuration, to relay connections to notebooks. If you use NHP or CHP for your proxy app, the websockets should work.

From the node-http-proxy readme:

You can activate the websocket support for the proxy using ws:true in the options.

//
// Create a proxy server for websockets
//
httpProxy.createServer({
  target: 'ws://localhost:9014',
  ws: true
}).listen(8014);

Post Status

Asked in February 2016
Viewed 3,493 times
Voted 14
Answered 1 times

Search




Leave an answer