Skip to content

SunnyQuic server

Configuration of sunnyquic inbound

Example:

tag: proxy
type: sunnyquic
bind-addr: "0.0.0.0:1443"
users:
  - username: "zhangsan"
    password: "12345678"
server-name: "echo.free.beeceptor.com" # must be the same as client
alpn: ["h3"]
congestion-control: bbr
zero-rtt: true

Fields

tag

  • Type: string
  • Required: yes

Required label for this endpoint.

default-outbound

  • Type: string (optional)
  • Required: no

Outbound this inbound prefers, stamped on every accepted request as UserContext::preferred_outbound. A router script may honor or override it; without a router it selects the outbound, and unset falls back to the global default.

bind-addr

  • Type: SocketAddr
  • Required: yes

Binding address. e.g. 0.0.0.0:443, [::1]:443

extra-bind-addrs

  • Type: list of SocketAddr
  • Required: no
  • Default: (type default)

Additional UDP listeners on the same noq endpoint.

users

Users for client authentication

server-name

  • Type: string
  • Required: yes

Server name of the certificates

cert-path

  • Type: path
  • Required: yes

Certificate path for tls

key-path

  • Type: path
  • Required: yes

Private key path for tls

max-path-num

  • Type: u32
  • Required: no
  • Default: 12

Maximum number of paths for multipath quic, 0 for disabling multipath

alpn

  • Type: list of string
  • Required: no
  • Default: vec!["h3".into()]

Alpn of tls. Default is ["h3"], must have common element with client

zero-rtt

  • Type: bool
  • Required: no
  • Default: true

0-RTT handshake. Set to true to enable zero rtt. Enabled by default

congestion-control

Congestion control, default to "bbr", supported: "bbr", "new-reno", "cubic"

initial-mtu

  • Type: u16
  • Required: no
  • Default: 1300

Initial mtu, must be larger than min mtu, at least to be 1200. 1400 is recommended for high packet loss network. default to be 1300

min-mtu

  • Type: u16
  • Required: no
  • Default: 1290

Minimum mtu, must be smaller than initial mtu, at least to be 1200. 1400 is recommended for high packet loss network. default to be 1290

gso

  • Type: bool
  • Required: no
  • Default: true

Enable QUIC Generic Segmentation Offload (GSO). Controls [quinn::TransportConfig::enable_segmentation_offload]. When supported, GSO reduces CPU usage for bulk sends; unsupported environments may see transient startup packet loss. Enabled by default

mtu-discovery

  • Type: bool
  • Required: no
  • Default: true

Enable auto MTU discovery, default to true For stable udp network, it's better to disable it and set a proper initial mtu

brutal

Brutal server configuration

user-store

  • Type: path (optional)
  • Required: no

Path of a YAML file persisting users and their traffic statistics. Loaded and merged with users at startup; written on every user change via API, periodically and on graceful shutdown. Optional, persistence is disabled when omitted.

user-store: "users.yaml"

store-flush-interval

  • Type: u64
  • Required: no
  • Default: 60

Interval in seconds for periodically flushing users and traffic statistics to the user-store file. Default is 60, set to 0 to disable periodic flushing (only API changes and shutdown persist). Only takes effect when user-store is set.

max-concurrent-bidi-streams

  • Type: u32
  • Required: no
  • Default: 1000

Streams the peer may hold open concurrently. Each proxied request and each UDP association holds one for its whole lifetime, so this is also the ceiling on concurrent sessions over a single connection; a peer that reaches it waits in open_bi until this side frees a stream. Worst-case buffering is this multiplied by stream-receive-window. Default 1000.

max-concurrent-uni-streams

  • Type: u32
  • Required: no
  • Default: 1000

Unidirectional streams the peer may hold open concurrently. With over-stream on, this side's UDP replies travel over these. Default 1000.

stream-receive-window

  • Type: u64
  • Required: no
  • Default: crate::quic::MAX_STREAM_WINDOW

Bytes the peer may have in flight on one stream, and therefore the most this side can be made to buffer for it. The default is a 400 Mbit/s bandwidth-delay product over a 100 ms path. Default 5000000.

receive-window

  • Type: u64 (optional)
  • Required: no

Bytes the peer may have in flight across every stream at once. Left out, the transport's own default is kept, which is unlimited — so the only bound on buffering is max-concurrent-bidi-streams multiplied by stream-receive-window. Setting it caps that independently of the stream count.

send-window

  • Type: u64 (optional)
  • Required: no
  • Default: crate::config::default_inbound_send_window()

Bytes this side may have in flight before it stalls waiting for acknowledgement. Default 40000000.