Skip to content

Config

Top-level configuration object. Every shadowquic config file deserializes into this struct.

Overall configuration of shadowquic.

Example:

inbounds:
- tag: proxy-in
  type: xxx
  xxx: xxx
outbounds:
- tag: proxy-out
  type: xxx
  xxx: xxx
dns:
 - tag: dns-in
   type: dns-udp
   xxx: xxx

router:
  default-outbound: proxy-out
  src: |
    return function(ctx) return "proxy-out" end
  # Or replace src with a file path:
  # path: route.lua
log-level: trace # or debug, info, warn, error
Supported inbound types are listed in InboundCfg

Supported outbound types are listed in OutboundCfg

Legacy inbound and outbound objects are also accepted. Missing tags on these objects default to inbound and outbound, respectively.

Fields

inbounds

Listeners to run concurrently. Tags must be nonempty and must not collide with DNS or outbound tags.

dns

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

Standalone DNS services. Tags must be nonempty and must not collide with inbound or outbound tags. DNS services are automatically registered as outbounds and traffic can be routed to it for hijacking. You can also route a dns traffic back to another DNS server. DNS requests will be exposed to router context for routing.

outbounds

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

Explicit outbounds. DNS services are also registered under their own tags.

router

  • Type: RouterCfg
  • Required: no
  • Default: (type default)

Request routing. Omit this section to use the first configured outbound.

log-level

  • Type: LogLevel
  • Required: no
  • Default: info