Documentation > Other Configuration > Daemon Configuration Options

Daemon Configuration Options

Index

  1. Introduction
  2. Network Socket Configuration File
    1. multicast address
    2. multicast port
    3. in interface
    4. out interface
    5. reuseaddr
    6. ttl

Introduction

joold expects an optional file as program argument.

$ joold [/path/to/netsocket/config]

If omitted, the daemon will attempt to find an adjacent file named netsocket.json and use that.

Only the network socket has available configuration as of now; the kernel socket is self-sufficient.

Network Socket Configuration File

This is a Json file that configures the daemon’s SS network socket. Here are two example of its contents:

IPv6 IPv4
{
	"multicast address": "ff08::db8:64:64",
	"multicast port": "6464",
	"in interface": "eth0",
	"out interface": "eth0",
	"reuseaddr": 1,
	"ttl": 3
}
{
	"multicast address": "233.252.0.64",
	"multicast port": "6464",
	"in interface": "192.0.2.1",
	"out interface": "192.0.2.1",
	"reuseaddr": 1,
	"ttl": 3
}

These are the options:

multicast address

  • Type: String (IPv4/v6 address)
  • Default: None (Field is mandatory)

Address the SS traffic will be sent to and listened from.

multicast port

  • Type: String (port number or service name)
  • Default: None (Field is mandatory)

TCP port where the SS traffic will be sent to and listened from.

in interface

  • Type: String
  • Default: NULL (kernel chooses an interface and address for you)

Address or interface to bind the socket in.

If multicast address is IPv4, this should be one addresses from the interface where the SS traffic is expected to be received. If multicast address is IPv6, this should be the name of the interface (eg. “eth0”).

Though they are optional, it is strongly recommended that you define both in interface and out interface to ensure the SS traffic does not leak through other interfaces.

out interface

  • Type: String
  • Default: NULL (kernel chooses an interface and address for you)

If multicast address is IPv4, this should be one addresses from the interface where the multicast traffic is expected to be sent. If multicast address is IPv6, this should be the name of the interface (eg. “eth0”).

Though they are optional, it is strongly recommended that you define both in interface and out interface to ensure the SS traffic does not leak through other interfaces.

reuseaddr

  • Type: Integer
  • Default: 0

Same as SO_REUSEADDR. From man 7 socket:

SO_REUSEADDR
	Indicates that the rules used in validating addresses supplied
	in a bind(2) call should allow reuse of local addresses. For
	AF_INET sockets this means that a socket may bind, except when
	there is an active listening socket bound to the address. When
	the listening socket is bound to INADDR_ANY with a specific port
	then it is not possible to bind to this port for any local
	address. Argument is an integer boolean flag.

A rather more humane explanation can be found in Stack Overflow:

In other words, for multicast addresses `SO_REUSEADDR` behaves exactly
as `SO_REUSEPORT` for unicast addresses.

...

Basically, `SO_REUSEPORT` allows you to bind an arbitrary number of
sockets to exactly the same source address and port as long as all prior
bound sockets also had `SO_REUSEPORT` set before they were bound. If the
first socket that is bound to an address and port does not have
`SO_REUSEPORT` set, no other socket can be bound to exactly the same
address and port, regardless if this other socket has `SO_REUSEPORT` set
or not, until the first socket releases its binding again.

You do not want a hanging joold to prevent future joolds from having access to the SS traffic, so there is likely no reason to ever turn this value off. Unless you have a specific reason to change this, you should always include this value, and always override the default.

ttl

  • Type: Integer
  • Default: 1

Same as IP_MULTICAST_TTL. From man 7 ip:

IP_MULTICAST_TTL (since Linux 1.2)
	Set or read the time-to-live value of outgoing multicast packets
	for this socket. It is very important for multicast packets to
	set the smallest TTL possible. The default is 1 which means that
	multicast packets don't leave the local network unless the user
	program explicitly requests it. Argument is an integer.