Radiator Server Documentation — v10.34.2
servers.http.listen
listen
The listen block sets the HTTP listener addresses and ports. Add a tls
block for HTTPS.
Basic Configuration
listen {
protocol tcp;
port 8000;
ip 0.0.0.0;
}
Parameters
| Parameter | Description | Required |
|---|---|---|
| protocol | Transport protocol: tcp | Yes |
| port | Port number to listen on | Conditional |
| ip | IP address(es) to bind (can specify multiple) | Conditional |
| addr | Combined IP address and port, instead of ip and port | Conditional |
| buffer | Socket buffer size in bytes | No |
| timeout | Connection idle timeout | No |
| keepalive | TCP keepalive configuration | No |
| tls | TLS configuration block (required to enable TLS) | Conditional |
Configure the listener address with ip and port, or with addr.
TLS Configuration
Add a tls block to the TCP listener to enable encryption. Without it, the
listener uses plaintext TCP. This applies to HTTP and TACACS+ listeners.
listen {
protocol tcp;
port 8443;
ip 0.0.0.0;
tls {
certificate "SERVER_CERT";
certificate_key "SERVER_KEY";
require_client_certificate false;
}
}
The TLS configuration enables HTTPS with HTTP/1.1 and HTTP/2 support. Certificate names reference certificates defined in the certificates block.
Multiple IP Addresses
You can bind to multiple IP addresses by specifying multiple ip statements:
listen {
protocol tcp;
port 8000;
ip 10.0.0.1; # Specific IPv4 address
ip 2001:db8::1; # Specific IPv6 address
}
To bind to all addresses, use ip 0.0.0.0; for IPv4 and ip ::; for IPv6. Do
not combine these with specific addresses of the same IP version on the same
port. The operating system rejects such overlapping bindings.
Example: HTTP with Timeout and Keepalive
listen {
protocol tcp;
port 8000;
ip 0.0.0.0;
# Close idle connections after 30 seconds
timeout 30s;
# TCP keepalive to detect dead connections
keepalive {
idle 60s;
interval 10s;
count 3;
}
}
See Also
- servers.http - HTTP server configuration
- servers.timeout - Connection timeout configuration
- servers.keepalive - TCP keepalive configuration