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
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
type | string | — | resolved | ssm-api | derp | ccm | ocm | oom-killer | Service type. Selects which option struct the rest of the object is decoded into. Some types only exist in builds carrying their tag — see Notes. |
tag | string | — | — | Unique name for this service, used in log lines. |
Source: option/service.go:16-20 · pinned at v1.13.15 (3708fa1)
Service types
| Type | What it runs |
|---|---|
resolved | A 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-api | The Shadowsocks Server Management API — an HTTP endpoint for creating and removing users on a running Shadowsocks inbound. |
derp | An embedded Tailscale DERP relay server. See Tailscale. |
ccm / ocm / oom-killer | Operational 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
resolvedembeds the sameListenOptionsas inbounds; when omitted,listendefaults to127.0.0.53andlisten_portto53.ssm-apitakes aserversmap (path → Shadowsocks inbound tag) and an optionalcache_path.- Build tags gate availability:
derpneedswith_tailscale,ccmneedswith_ccm,ocmneedswith_ocm.resolved,ssm-apiandoom-killerare always compiled in. - An unregistered
typefails 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)
