# sing-box

sing-box is a Go-based proxy platform maintained by [SagerNet](https://github.com/SagerNet/sing-box). It sits in the same slot as [[mihomo]] and Xray-core: a proxy engine that speaks multiple inbound and outbound protocols, applies a rule-based routing layer, and runs as either a daemon or an embedded library.

## What it does

Roughly: take inbound traffic (from a TUN interface, HTTP proxy, SOCKS5, transparent proxy, etc.), run it through a routing DAG that decides which outbound to use (direct, blocked, or a specific proxy), and hand it off. The outbounds cover most of the modern circumvention protocol surface:

- VMess, VLESS, Trojan, Shadowsocks
- Hysteria, Hysteria2, TUIC (UDP-over-QUIC variants)
- WireGuard
- ShadowTLS, Naive, SSH
- Selector / URLTest / LoadBalance (protocol-level proxy groups)

Configuration is JSON (unlike Clash/mihomo's YAML). The routing rules are expressed as a list of matchers (domain, geoip, geosite, process-name, user) plus an outbound name, evaluated in order.

## Why it matters for the wiki

Several tools in the toolbox wrap or embed sing-box rather than reimplement this protocol stack:

- [[karing]] ships a [Karing-team fork](https://github.com/KaringX/sing-box) with a Flutter GUI wrapped around it.
- [[mihomo]] isn't a sing-box fork, but the two engines solve the same problem and tend to share rule-file formats via GeoIP/GeoSite standards.
- v2rayN's TUN mode [uses sing-box under the hood](https://github.com/2dust/v2rayN) to create the virtual interface — mentioned in [[xray-tutorial]].
- Router-side setups like [[xkeen]] can run sing-box as an alternative core to Xray.

Understanding sing-box helps read many of the clients in [[toolbox/index|the toolbox]] because they are thin UIs on top of it.

## Relationship to Xray-core

Xray-core (covered implicitly in [[xray-tutorial]] and [[3x-ui]]) and sing-box are the two dominant Go-based proxy cores in the Clash/V2Ray ecosystem. They overlap heavily on protocols — both speak VLESS, VMess, Trojan, Shadowsocks. Differences are mostly operational:

- **sing-box** is more aggressive about adopting newer protocols (Hysteria2, TUIC, ShadowTLS) and is the preferred core for mobile clients because it embeds cleanly.
- **Xray-core** has deeper deployment history on servers, with a bigger panel ecosystem (see [[3x-ui]]) and more subscription-format tooling built around it.

Clients like [[happ-proxy]] and Karing can point at either — from the subscription layer they look interchangeable, and the [[vless-subscription-format]] URL works in both.

## Repo

https://github.com/SagerNet/sing-box — Go, GPLv3 with commercial use requirements. Documentation at [sing-box.sagernet.org](https://sing-box.sagernet.org/).

## Related

- [[karing]] — Flutter GUI on a Karing-team sing-box fork
- [[mihomo]] — alternative Go proxy core
- [[3x-ui]] — panel for the Xray-core half of this ecosystem
- [[xkeen]] — router-level deployment that can use sing-box as its core
- [[vless-subscription-format]] — the subscription wire format consumed by both sing-box and Xray
