Skip to content

Server

All server settings fall under [server].

[server]
log_level = "trace"

[server.listen]
port = "8080"

log_file

Specifies an alternative path to use when logging information while the server is running.

String representing the path to the file.

Example
[server]
log_file = "/path/to/file.log"

log_level

Specifies the log level used when logging information while the server is running.

String representing the level. [default: info] Choices are off, error, warn, info, debug, trace.

Example
[server]
log_level = "info"

listen.host

IP address that the server will bind to.

String describing the interface the server should bind to. [default: any]

  • ssh - the server will reply from the IP address that the SSH connection came from (as found in the SSH_CONNECTION environment variable). This is useful for multihomed servers.

  • any - the server will reply on the default interface and will not bind to a particular IP address. This can be useful if the connection is made through ssh or another tool that makes the ssh connection appear to come from localhost.

  • <IP> - the server will attempt to bind to the specified IP address.

Example
[server]
[server.listen]
host = "192.168.1.5"

listen.port

Port(s) that the server will attempt to bind to.

String that can be in the form of PORT or PORT1:PORTN to provide a range of ports. [default: 0]

With 0, the server will let the operating system pick an available TCP port.

Note

This option does not affect the server-side port used by ssh.

Example
[server]
[server.listen]
port = "8080:8089"

listen.use_ipv6

Whether to bind to the ipv6 interface if host is any instead of ipv4.

Boolean indicating to use ipv6. [default: false]

Example
[server]
[server.listen]
use_ipv6 = true

listen.shutdown

Logic to apply to server when determining when to shutdown.

String representing shutdown rule. [default: never]

  • never - server will never automatically shut down.
  • after=<N> - server will shut down after N seconds.
  • lonely=<N> - server will shut down after N seconds with no connections.
Example
[server]
[server.listen]
shutdown = "lonely=60"

listen.current_dir

Current working directory (cwd) for the server.

String representing the path of the current working directory. [default: parent proc cwd]

Example
[server]
[server.listen]
current_dir = "/path/to/dir"

watch.native

Use native filesystem watching (more efficient).

Boolean indicating whether to use native filesystem watching or leverage a software polling of files and directories to detect changes. [default: true]

Example
[server]
[server.watch]
native = false

watch.poll_interval

Time between polls of files being watched, only relevant when using the polling watcher implementation (ignored with native watcher).

Integer time in seconds.

Example
[server]
[server.watch]
poll_interval = 30

watch.compare_contents

Load a file and compare its contents to detect file changes, only relevant when using the polling watcher implementation (very slow).

Boolean indicating if contents should be loaded to check for changes. [default: false]

Example
[server]
[server.watch]
compare_contents = true

watch.debounce_timeout

Maximum time to wait for filesystem changes before reporting them, which is useful to avoid noisy changes as well as serves to consolidate different events that represent the same action.

Time in seconds to wait for filesystem changes. [default: 2]

Example
[server]
[server.watch]
debounce_timeout = 0.5

watch.debounce_tick_rate

How often in seconds to check for new events before the debounce timeout occurs.

Time in seconds between checks for new events. [default: 1/4 of debounce_timeout]

Example
[server]
[server.watch]
debounce_tick_rate = 0.125