Server Configuration
Corresponds to the server section of the configuration file.
| Field | Type | Default | Description |
|---|---|---|---|
host | string | 0.0.0.0 | Listening address. 0.0.0.0 allows LAN/external access; 127.0.0.1 restricts it to this machine. |
port | number | 5233 | Listening port. |
tls.enabled | bool | false | Whether to enable HTTPS. |
tls.cert_file | string | "" | Path to the certificate file (PEM). Required when TLS is enabled. |
tls.key_file | string | "" | Path to the private key file (PEM). Required when TLS is enabled. |
cors.enabled | bool | true | Whether to enable cross-origin support. |
cors.allowed_origins | string[] | ["*"] | List of origins allowed to make cross-origin requests, such as ["https://example.com"]. * allows all origins. |
ip_extractor | string | "direct" | How the client's real IP is obtained; see the table below. |
trusted_proxies | string[] | [] | List of trusted proxies (CIDR or IP). Only takes effect when ip_extractor is xff or real_ip. |
Values of ip_extractor:
| Value | Description |
|---|---|
direct | Use the source IP of the TCP connection. Use this for direct deployments (no reverse proxy). |
xff | Parse the real IP from the X-Forwarded-For header. Use this behind reverse proxies such as Nginx or Cloudflare. |
real_ip | Parse the real IP from the X-Real-IP header. Suitable for the default Nginx forwarding setup. |
