Bind

The Bind option instructs Itsi on which network interfaces to listen on. It supports various protocols and formats to allow flexible binding to TCP/IP addresses or Unix sockets, with optional TLS configuration. You can bind to multiple interfaces at once.

Bind Formats

You can specify the bind address as a URI. Common formats include:

  • TCP/HTTP:

    bind "http://0.0.0.0:3000"

    Listens on all interfaces on port 3000 using plain HTTP.

  • TCP/HTTPS:

    bind "https://0.0.0.0:3000?cert=/path/to/cert.pem&key=/path/to/key.pem"

    Listens on all interfaces on port 3000 using HTTPS. TLS options (e.g. certificates) can be provided via query parameters. You can also use cert=acme with additional ACME parameters to enable automatic certificate retrieval. E.g.

    bind "https://0.0.0.0:3000?cert=acme&[email protected]&domains=domain1.com,domain2.com"
  • Unix Socket:

    bind "unix:///tmp/itsi.sock"

    Listens using a Unix domain socket.

  • TLS over Unix Socket:

    bind "tls:///tmp/itsi.sock"

    Listens using a Unix socket while enabling TLS.

Configuration File

In your configuration file (typically Itsi.rb), specify the bind option using the bind function.

Examples

Itsi.rb
# Bind to all interfaces on port 3000 with HTTP:
bind "http://0.0.0.0:3000"
Itsi.rb
# Bind to all interfaces on port 3000 with HTTPS using certificate files:
bind "https://0.0.0.0:3000?cert=/path/to/cert.pem&key=/path/to/key.pem"
Itsi.rb
# Bind to a Unix socket:
bind "unix:///tmp/itsi.sock"

Command Line

Bind addresses can also be specified from the command line via the -b or --bind option:

itsi -b "http://0.0.0.0:3000" -b "https://0.0.0.0:3001"