@@ -19,138 +19,137 @@ pairs.
19
19
20
20
### ` command `
21
21
22
- > One of:
23
- >
24
- > - A list of strings that is the command used to start the
25
- > process. The following template strings will be replaced:
26
- >
27
- > - ` {port} ` the port that the process should listen on. This will be 0 if
28
- > it should use a Unix socket instead.
29
- > - ` {unix_socket} ` the path at which the process should listen on a Unix
30
- > socket. This will be an empty string if it should use a TCP port.
31
- > - ` {base_url} ` the base URL of the notebook
32
- >
33
- > For example, if the application needs to know its full path it can
34
- > be constructed from ` {base_url}/proxy/{port} `
35
- >
36
- > - A callable that takes any {ref}` callable arguments <server-process/callable-arguments> ` ,
37
- > and returns a list of strings that are used & treated same as above.
38
- >
39
- > If the command is not specified or is an empty list, the server process is
40
- > assumed to be started ahead of time and already available to be proxied to.
22
+ One of:
23
+
24
+ - A list of strings that is the command used to start the
25
+ process. The following template strings will be replaced:
26
+
27
+ - ` {port} ` the port that the process should listen on. This will be 0 if it
28
+ should use a Unix socket instead.
29
+ - ` {unix_socket} ` the path at which the process should listen on a Unix
30
+ socket. This will be an empty string if it should use a TCP port.
31
+ - ` {base_url} ` the base URL of the notebook. For example, if the application
32
+ needs to know its full path it can be constructed from
33
+ ` {base_url}/proxy/{port} `
34
+
35
+ - A callable that takes any {ref}` callable arguments <server-process/callable-arguments> ` ,
36
+ and returns a list of strings that are used & treated same as above.
37
+
38
+ If the command is not specified or is an empty list, the server process is
39
+ assumed to be started ahead of time and already available to be proxied to.
41
40
42
41
### ` timeout `
43
42
44
- > Timeout in seconds for the process to become ready, default ` 5 ` .
45
- >
46
- > A process is considered 'ready' when it can return a valid HTTP response on the
47
- > port it is supposed to start at.
43
+ Timeout in seconds for the process to become ready, default ` 5 ` .
44
+
45
+ A process is considered 'ready' when it can return a valid HTTP response on the
46
+ port it is supposed to start at.
48
47
49
48
### ` environment `
50
49
51
- > One of:
52
- >
53
- > - A dictionary of strings that are passed in as the environment to
54
- > the started process, in addition to the environment of the notebook
55
- > process itself. The strings ` {port} ` , ` {unix_socket} ` and
56
- > ` {base_url} ` will be replaced as for ** command** .
57
- > - A callable that takes any {ref}` callable arguments <server-process/callable-arguments> ` ,
58
- > and returns a dictionary of strings that are used & treated same as above.
50
+ One of:
51
+
52
+ - A dictionary of strings that are passed in as the environment to
53
+ the started process, in addition to the environment of the notebook
54
+ process itself. The strings ` {port} ` , ` {unix_socket} ` and
55
+ ` {base_url} ` will be replaced as for ** command** .
56
+ - A callable that takes any {ref}` callable arguments <server-process/callable-arguments> ` ,
57
+ and returns a dictionary of strings that are used & treated same as above.
59
58
60
59
### ` absolute_url `
61
60
62
- > * True* if the URL as seen by the proxied application should be the full URL
63
- > sent by the user. * False* if the URL as seen by the proxied application should
64
- > see the URL after the parts specific to jupyter-server-proxy have been stripped.
65
- >
66
- > For example, with the following config:
67
- >
68
- > ``` python
69
- > c.ServerProxy.servers = {
70
- > ' test-server' : {
71
- > ' command' : [' python3' , ' -m' , ' http.server' , ' {port} ' ],
72
- > ' absolute_url' : False
73
- > }
74
- > }
75
- > ```
76
- >
77
- > When a user requests `/ test- server/ some- url` , the proxied server will see it
78
- > as a request for `/ some- url` - the `/ test- server` part is stripped out.
79
- >
80
- > If `absolute_url` is set to `True ` instead, the proxied server will see it
81
- > as a request for `/ test- server/ some- url` instead - without any stripping.
82
- >
83
- > This is very useful with applications that require a `base_url` to be set .
84
- >
85
- > Defaults to * False * .
61
+ * True* if the URL as seen by the proxied application should be the full URL
62
+ sent by the user. * False* if the URL as seen by the proxied application should
63
+ see the URL after the parts specific to jupyter-server-proxy have been stripped.
64
+
65
+ For example, with the following config:
66
+
67
+ ``` python
68
+ c.ServerProxy.servers = {
69
+ ' test-server' : {
70
+ ' command' : [' python3' , ' -m' , ' http.server' , ' {port} ' ],
71
+ ' absolute_url' : False
72
+ }
73
+ }
74
+ ```
75
+
76
+ When a user requests ` /test-server/some-url ` , the proxied server will see it
77
+ as a request for ` /some-url ` - the ` /test-server ` part is stripped out.
78
+
79
+ If ` absolute_url ` is set to ` True ` instead, the proxied server will see it
80
+ as a request for ` /test-server/some-url ` instead - without any stripping.
81
+
82
+ This is very useful with applications that require a ` base_url ` to be set.
83
+
84
+ Defaults to * False* .
86
85
87
86
### ` port `
88
87
89
- > Set the port that the service will listen on. The default is to
90
- > automatically select an unused port.
88
+ Set the port that the service will listen on. The default is to
89
+ automatically select an unused port.
91
90
92
91
(server-process-unix-socket)=
93
92
94
93
### ` unix_socket `
95
94
96
- > This option uses a Unix socket on a filesystem path, instead of a TCP
97
- > port. It can be passed as a string specifying the socket path, or * True * for
98
- > Jupyter Server Proxy to create a temporary directory to hold the socket,
99
- > ensuring that only the user running Jupyter can connect to it.
100
- >
101
- > If this is used, the `{unix_socket}` argument in the command template
102
- > (see {ref}`server- process- cmd` ) will be a filesystem path. The server should
103
- > create a Unix socket bound to this path and listen for HTTP requests on it.
104
- > The `port` configuration key will be ignored.
105
- >
106
- > ::: {note}
107
- > Proxying websockets over a Unix socket requires Tornado >= 6.3 .
108
- > :::
95
+ This option uses a Unix socket on a filesystem path, instead of a TCP
96
+ port. It can be passed as a string specifying the socket path, or * True* for
97
+ Jupyter Server Proxy to create a temporary directory to hold the socket,
98
+ ensuring that only the user running Jupyter can connect to it.
99
+
100
+ If this is used, the ` {unix_socket} ` argument in the command template
101
+ (see {ref}` server-process-cmd ` ) will be a filesystem path. The server should
102
+ create a Unix socket bound to this path and listen for HTTP requests on it.
103
+ The ` port ` configuration key will be ignored.
104
+
105
+ ``` {note}
106
+ Proxying websockets over a Unix socket requires Tornado >= 6.3.
107
+ ```
109
108
110
109
### ` mappath `
111
110
112
- > Map request paths to proxied paths.
113
- > Either a dictionary of request paths to proxied paths,
114
- > or a callable that takes parameter `path` and returns the proxied path.
111
+ Map request paths to proxied paths.
112
+ Either a dictionary of request paths to proxied paths,
113
+ or a callable that takes parameter ` path ` and returns the proxied path.
115
114
116
115
### ` launcher_entry `
117
116
118
- > A dictionary with options on if / how an entry in the classic Jupyter Notebook
119
- > ' New' dropdown or the JupyterLab launcher should be added. It can contain
120
- > the following keys:
121
- >
122
- > 1 . ** enabled**
123
- > Set to True (default) to make an entry in the launchers. Set to False to have no
124
- > explicit entry.
125
- > 2 . ** icon_path**
126
- > Full path to an svg icon that could be used with a launcher. Currently only used by the
127
- > JupyterLab launcher
128
- > 3 . ** title**
129
- > Title to be used for the launcher entry. Defaults to the name of the server if missing.
117
+ A dictionary with options on if / how an entry in the classic Jupyter Notebook
118
+ 'New' dropdown or the JupyterLab launcher should be added. It can contain
119
+ the following keys:
120
+
121
+ 1 . ** enabled**
122
+ Set to True (default) to make an entry in the launchers. Set to False to have no
123
+ explicit entry.
124
+ 2 . ** icon_path**
125
+ Full path to an svg icon that could be used with a launcher. Currently only used by the
126
+ JupyterLab launcher
127
+ 3 . ** title**
128
+ Title to be used for the launcher entry. Defaults to the name of the server if missing.
130
129
131
130
### ` new_browser_tab `
132
131
133
- > * JupyterLab only* - * True * if the proxied server URL should be opened in a new browser tab.
134
- > * False * (default) if the proxied server URL should be opened in a new JupyterLab tab.
135
- >
136
- > If * False * , the proxied server needs to allow its pages to be rendered in an iframe. This
137
- > is generally done by configuring the web server `X- Frame- Options` to `SAMEORIGIN ` .
138
- > For more information, refer to
139
- > [MDN Web docs on X- Frame- Options](https:// developer.mozilla.org/ docs/ Web/ HTTP / Headers/ X- Frame- Options).
140
- >
141
- > Note that applications might use a different terminology to refer to frame options.
142
- > For example, RStudio uses the term * frame origin* and require the flag
143
- > `-- www- frame- origin=same` to allow rendering of its pages in an iframe.
132
+ * JupyterLab only* - * True* if the proxied server URL should be opened in a new browser tab.
133
+ * False* (default) if the proxied server URL should be opened in a new JupyterLab tab.
134
+
135
+ If * False* , the proxied server needs to allow its pages to be rendered in an iframe. This
136
+ is generally done by configuring the web server ` X-Frame-Options ` to ` SAMEORIGIN ` .
137
+ For more information, refer to
138
+ [ MDN Web docs on X-Frame-Options] ( https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Frame-Options ) .
139
+
140
+ Note that applications might use a different terminology to refer to frame options.
141
+ For example, RStudio uses the term * frame origin* and require the flag
142
+ ` --www-frame-origin=same ` to allow rendering of its pages in an iframe.
144
143
145
144
### ` request_headers_override `
146
145
147
- > One of:
148
- >
149
- > - A dictionary of strings that are passed in as HTTP headers to the proxy
150
- > request. The strings `{port}` and `{base_url}` will be replaced as
151
- > for ** command** .
152
- > - A callable that takes any {ref}`callable arguments < server- process/ callable - arguments> ` ,
153
- > and returns a dictionary of strings that are used & treated same as above.
146
+ One of:
147
+
148
+ - A dictionary of strings that are passed in as HTTP headers to the proxy
149
+ request. The strings ` {port} ` and ` {base_url} ` will be replaced as
150
+ for ** command** .
151
+ - A callable that takes any {ref}` callable arguments <server-process/callable-arguments> ` ,
152
+ and returns a dictionary of strings that are used & treated same as above.
154
153
155
154
(server-process-callable-arguments)=
156
155
0 commit comments