Skip to content

Services

services run background components that are neither inbounds nor outbounds: a systemd-resolved replacement, a Shadowsocks server management API, a Tailscale DERP relay, and a few operational helpers. The entry shape is the same flat envelope as everywhere else in the config — type / tag plus the selected type's own fields at the same level.

Envelope

FieldTypeDefaultAllowed valuesDescription
typestringresolved | ssm-api | derp | ccm | ocm | oom-killerService type. Selects which option struct the rest of the object is decoded into. Some types only exist in builds carrying their tag — see Notes.
tagstringUnique name for this service, used in log lines.

Source: option/service.go:16-20 · pinned at v1.13.15 (3708fa1)

Service types

TypeWhat it runs
resolvedA drop-in replacement for systemd-resolved: a DNS stub listener (defaults to 127.0.0.53:53) that answers via sing-box DNS. Pairs with the resolved DNS server type.
ssm-apiThe Shadowsocks Server Management API — an HTTP endpoint for creating and removing users on a running Shadowsocks inbound.
derpAn embedded Tailscale DERP relay server. See Tailscale.
ccm / ocm / oom-killerOperational helpers (connection/object management, out-of-memory guard) intended for embedded and mobile deployments.

Minimal example

json
{
  "services": [
    {
      "type": "resolved",
      "tag": "resolved",
      "listen": "127.0.0.53",
      "listen_port": 53
    }
  ]
}

Notes

  • resolved embeds the same ListenOptions as inbounds; when omitted, listen defaults to 127.0.0.53 and listen_port to 53.
  • ssm-api takes a servers map (path → Shadowsocks inbound tag) and an optional cache_path.
  • Build tags gate availability: derp needs with_tailscale, ccm needs with_ccm, ocm needs with_ocm. resolved, ssm-api and oom-killer are always compiled in.
  • An unregistered type fails at startup with "unknown service type".

Cross-core notes

  • Xray-core has no service list; the closest analogues are the API and Metrics blocks, which spawn management listeners from dedicated config keys.
  • mihomo exposes management through the external controller rather than configurable background services.

Source: option/service.go:16-20 · v1.13.15 (3708fa1)

Core Tutorial by Argsment