Socket struct defines a network socket on which the server will listen and expose services.
Structure
Unique socket name. Can be used on the command line to override the socket’s address:
--socket-addr <name>=<addr>--socket-fd <name>=<fd>
Address/port on which this socket will listen. If not specified, must be provided via command-line flag.Examples:
*:80: Listen on port 80 on all local IPv4 and IPv6 interfaces1.2.3.4: Listen on specific IPv4 address on default port1.2.3.4:80: Listen on specific IPv4 address and port1234:5678::abcd: Listen on specific IPv6 address on default port[1234:5678::abcd]:80: Listen on specific IPv6 address and portunix:/path/to/socket: Listen on Unix socketunix-abstract:name: On Linux, listen on abstract Unix socketexample.com:80: DNS lookup to determine address
Service name which should handle requests on this socket.
Protocol configuration
Each socket must specify one of the following protocols:HTTP
Serve unencrypted HTTP.
HTTP style:
host: Normal HTTP (path in request line, separate Host header)proxy: HTTP proxy protocol (full URL in request line)
Header name (e.g.,
X-Forwarded-Proto) that specifies the original protocol (http or https) when behind a reverse proxy.Header name for encoding/parsing the
request.cf object as JSON.Headers automatically injected into all requests. Useful for adding authorization tokens.
Headers automatically injected into all responses.
HTTPS
Serve encrypted HTTPS.
options: HttpOptions (same as http)tlsOptions: TlsOptions (TLS configuration)
Private key and certificate chain.
privateKey: PEM format (PKCS8, traditional RSA/DSA)certificateChain: PEM format, starting with leaf certificate
embed directive to read from files.If true, reject connections without client certificates signed by trusted CAs.
If true, trust certificates signed by browser-trusted CAs. Set true for public internet connections.
Additional CA certificates to trust, in PEM format.
Minimum TLS version:
goodDefault: Maintainer-chosen default (recommended)ssl3,tls1Dot0,tls1Dot1,tls1Dot2,tls1Dot3
OpenSSL cipher list string. Generally only override for extreme compatibility needs or to quickly disable a broken algorithm.