Show More
@@ -214,15 +214,10 b' class IPythonHandler(AuthenticatedHandler):' | |||
|
214 | 214 | def ws_url(self): |
|
215 | 215 | """websocket url matching the current request |
|
216 | 216 | |
|
217 | turns http[s]://host[:port] into | |
|
218 | ws[s]://host[:port] | |
|
217 | By default, this is just `''`, indicating that it should match | |
|
218 | the same host, protocol, port, etc. | |
|
219 | 219 | """ |
|
220 | proto = self.request.protocol.replace('http', 'ws') | |
|
221 | host = self.settings.get('websocket_host', '') | |
|
222 | # default to config value | |
|
223 | if host == '': | |
|
224 | host = self.request.host # get from request | |
|
225 | return "%s://%s" % (proto, host) | |
|
220 | return self.settings.get('websocket_url', '') | |
|
226 | 221 | |
|
227 | 222 | @property |
|
228 | 223 | def mathjax_url(self): |
@@ -425,8 +425,12 b' class NotebookApp(BaseIPythonApplication):' | |||
|
425 | 425 | elif not new.endswith('/'): |
|
426 | 426 | self.base_kernel_url = new+'/' |
|
427 | 427 | |
|
428 |
websocket_ |
|
|
429 |
help="""The |
|
|
428 | websocket_url = Unicode("", config=True, | |
|
429 | help="""The base URL for the websocket server, | |
|
430 | if it differs from the HTTP server (hint: it almost certainly doesn't). | |
|
431 | ||
|
432 | Should be in the form of an HTTP origin: ws[s]://hostname[:port] | |
|
433 | """ | |
|
430 | 434 | ) |
|
431 | 435 | |
|
432 | 436 | extra_static_paths = List(Unicode, config=True, |
@@ -102,7 +102,11 b' var IPython = (function (IPython) {' | |||
|
102 | 102 | console.log("Kernel started: ", json.kernel_id); |
|
103 | 103 | this.running = true; |
|
104 | 104 | this.kernel_id = json.kernel_id; |
|
105 |
|
|
|
105 | var ws_url = json.ws_url; | |
|
106 | if (ws_url.match(/wss?:\/\//) == null) { | |
|
107 | ws_url = "ws" + location.origin.substr(4) + ws_url; | |
|
108 | }; | |
|
109 | this.ws_url = ws_url; | |
|
106 | 110 | this.kernel_url = this.base_url + "/" + this.kernel_id; |
|
107 | 111 | this.start_channels(); |
|
108 | 112 | $([IPython.events]).trigger('status_started.Kernel', {kernel: this}); |
General Comments 0
You need to be logged in to leave comments.
Login now