Skip to content

Commit

Permalink
Document unix_socket as a parameter for callables in config
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Aug 28, 2024
1 parent 44b5405 commit 1c8f1d3
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions docs/source/server-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ For example, RStudio uses the term _frame origin_ and require the flag
One of:

- A dictionary of strings that are passed in as HTTP headers to the proxy
request. The strings `{port}` and `{base_url}` will be replaced as
for **command**.
request. The strings `{port}`, `{unix_socket}` and `{base_url}` will be
replaced as for **command**.
- A callable that takes any {ref}`callable arguments <server-process:callable-arguments>`,
and returns a dictionary of strings that are used & treated same as above.

Expand Down Expand Up @@ -181,9 +181,11 @@ server as raw stream data. This is similar to running a
[websockify](https://github.com/novnc/websockify) wrapper.
All other HTTP requests return 405.

#### Callable arguments
### Callable arguments

Any time you specify a callable in the config, it can ask for any arguments it needs
Certain config options accept callables, as documented above. This should return
the same type of object that the option normally expects.
When you use a callable this way, it can ask for any arguments it needs
by simply declaring it - only arguments the callable asks for will be passed to it.

For example, with the following config:
Expand Down Expand Up @@ -213,13 +215,18 @@ The `port` argument will be passed to the callable. This is a simple form of dep
injection that helps us add more parameters in the future without breaking backwards
compatibility.

##### Available arguments
#### Available arguments

Currently, the following arguments are available:
Unless otherwise documented for specific options, the arguments available for
callables are:

1. **port**
The port the command should listen on
2. **base_url**
The TCP port on which the server should listen, or is listening.
This is 0 if a Unix socket is used instead of TCP.
2. **unix_socket**
The path of a Unix socket on which the server should listen, or is listening.
This is an empty string if a TCP socket is used.
3. **base_url**
The base URL of the notebook

If any of the returned strings, lists or dictionaries contain strings
Expand Down

0 comments on commit 1c8f1d3

Please sign in to comment.