Skip to content

allow multiple listeners in the config

Benjamin Lee requested to merge benjamin/multiple-listeners into main

Specifying multiple listeners is necessary to support complement (#36), because it requires listening for federation traffic on one port with TLS, and listening for client traffic on a different port without TLS. The way we implemented it here is a breaking change to the config.

Breaking config file change

Instead of a single pair of port and addr keys, we now have listen with is a list of places to listen for connections. Previously, setting a TLS cert/key in the tls section would cause TLS to be used for the listener. Now, TLS must be explicitly enabled on each listener with tls = true

Old:

port = 1234
addr = "1.2.3.4"

New:

[[listen]]
type = "tcp"
port = 1234
addr = "1.2.3.4"

Old:

port = 1234
addr = "1.2.3.4"

[tls]
certs = "/var/cert.pem"
key = "/var/key.pem"

New:

[tls]
certs = "/var/cert.pem"
key = "/var/key.pem"

[[listen]]
type = "tcp"
port = 1234
addr = "1.2.3.4"
tls = true

Currently tcp is the only supported type, but we intend to add support for unix sockets in the future.

Edited by Charles Hall

Merge request reports