mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
let websocket server be traited config option
This commit is contained in:
parent
bd7f1f941c
commit
332fdf662c
@ -173,7 +173,10 @@ class AuthenticatedHandler(RequestHandler):
|
||||
ws[s]://host[:port]
|
||||
"""
|
||||
proto = self.request.protocol.replace('http', 'ws')
|
||||
return "%s://%s" % (proto, self.request.host)
|
||||
host = self.application.ipython_app.websocket_host # default to config value
|
||||
if host == '':
|
||||
host = self.request.host # get from request
|
||||
return "%s://%s" % (proto, host)
|
||||
|
||||
|
||||
class AuthenticatedFileHandler(AuthenticatedHandler, web.StaticFileHandler):
|
||||
|
@ -300,6 +300,9 @@ class NotebookApp(BaseIPythonApplication):
|
||||
help='''The base URL for the notebook server''')
|
||||
base_kernel_url = Unicode('/', config=True,
|
||||
help='''The base URL for the kernel server''')
|
||||
websocket_host = Unicode("", config=True,
|
||||
help="""The hostname for the websocket server."""
|
||||
)
|
||||
|
||||
mathjax_url = Unicode("", config=True,
|
||||
help="""The url for MathJax.js."""
|
||||
|
Loading…
Reference in New Issue
Block a user