Skip to content

Commit 39194fc

Browse files
committed
Some doc fixes
1 parent b237195 commit 39194fc

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

docs/source/server-process.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ pairs.
6060

6161
* A dictionary of strings that are passed in as the environment to
6262
the started process, in addition to the environment of the notebook
63-
process itself. The strings ``{port}`` and ``{base_url}`` will be
64-
replaced as for **command**.
63+
process itself. The strings ``{port}``, ``{unix_socket}`` and
64+
``{base_url}`` will be replaced as for **command**.
6565

6666
* A callable that takes any :ref:`callable arguments <server-process/callable-arguments>`,
6767
and returns a dictionary of strings that are used & treated same as above.
@@ -111,11 +111,14 @@ pairs.
111111
Jupyter Server Proxy to create a temporary directory to hold the socket,
112112
ensuring that only the user running Jupyter can connect to it.
113113

114-
If this is used, the ``{port}`` argument in the command template
115-
(see :ref:`server-process-cmd`) will be a filesystem path for this socket
116-
instead of a port number. The server should create a Unix socket bound to
117-
this path and listen for HTTP requests on it. The ``port`` configuration key
118-
will be ignored.
114+
If this is used, the ``{unix_socket}`` argument in the command template
115+
(see :ref:`server-process-cmd`) will be a filesystem path. The server should
116+
create a Unix socket bound to this path and listen for HTTP requests on it.
117+
The ``port`` configuration key will be ignored.
118+
119+
.. note::
120+
121+
Proxying websockets over a Unix socket requires Tornado >= 6.3.
119122

120123

121124
``mappath``

jupyter_server_proxy/config.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ class ServerProxy(Configurable):
146146
Value should be a dictionary with the following keys:
147147
command
148148
An optional list of strings that should be the full command to be executed.
149-
The optional template arguments {{port}} and {{base_url}} will be substituted with the
150-
port the process should listen on and the base-url of the notebook.
149+
The optional template arguments {{port}}, {{unix_socket}} and {{base_url}}
150+
will be substituted with the port or Unix socket path the process should
151+
listen on and the base-url of the notebook.
151152
152153
Could also be a callable. It should return a list.
153154
@@ -157,7 +158,7 @@ class ServerProxy(Configurable):
157158
158159
environment
159160
A dictionary of environment variable mappings. As with the command
160-
traitlet, {{port}} and {{base_url}} will be substituted.
161+
traitlet, {{port}}, {{unix_socket}} and {{base_url}} will be substituted.
161162
162163
Could also be a callable. It should return a dictionary.
163164
@@ -171,6 +172,13 @@ class ServerProxy(Configurable):
171172
port
172173
Set the port that the service will listen on. The default is to automatically select an unused port.
173174
175+
unix_socket
176+
If set, the service will listen on a Unix socket instead of a TCP port.
177+
Set to True to use a socket in a new temporary folder, or a string
178+
path to a socket. This overrides port.
179+
180+
Proxying websockets over a Unix socket requires Tornado >= 6.3.
181+
174182
mappath
175183
Map request paths to proxied paths.
176184
Either a dictionary of request paths to proxied paths,
@@ -202,7 +210,7 @@ class ServerProxy(Configurable):
202210
203211
request_headers_override
204212
A dictionary of additional HTTP headers for the proxy request. As with
205-
the command traitlet, {{port}} and {{base_url}} will be substituted.
213+
the command traitlet, {{port}}, {{unix_socket}} and {{base_url}} will be substituted.
206214
207215
rewrite_response
208216
An optional function to rewrite the response for the given service.

0 commit comments

Comments
 (0)