Automation & integrations

What is sing-box

What it is

An open-source engine for encrypted tunnels with many protocols, TUN mode and rule sets. Often built into client apps as the core that does all the network work.

How we use it

As the engine inside a client app, or as a second engine next to Xray, so the app can switch between them through a thin settings layer.

What it is in plain words

sing-box is an open-source program written in Go that builds encrypted tunnels and routes traffic by rules. One engine supports many protocols: VLESS, VMess, Trojan, Shadowsocks, Hysteria2, TUIC and WireGuard. That is why it is often built into client apps as the core that does all the network work, while the app itself handles the interface and settings.

Where it helps a business

  • A client app for an encrypted network needs one engine that speaks many protocols rather than a separate library for each.
  • Traffic on a device must be split by rules: internal company systems through the tunnel, everything else direct.
  • An app should have a second engine to switch to if the main one has problems on some system.

How it is built

  • Inbounds and outbounds, as in Xray: an inbound accepts traffic, an outbound sends it to a server, direct or nowhere.
  • TUN mode. sing-box creates a virtual network adapter on the device and takes traffic from every app, not only from those that support a local gateway setting.
  • Rule sets. Domain and IP lists are packed into compact binary .srs files that the engine can refresh by itself. The rules decide which traffic goes into the tunnel.
  • DNS by rules. Different domains can be resolved through different DNS servers, so internal company names resolve through the internal server.
  • Configuration in JSON, which an app generates for the user and passes to the engine.

sing-box and Xray

sing-boxXray
Protocolsvery wide, including Hysteria2, TUIC, WireGuardVLESS, VMess, Trojan, Shadowsocks
StrengthsTUN mode, rule sets, client appsVLESS, Reality and XHTTP first, servers and panels
Configurationits own JSON formatJSON in the V2Ray tradition
Typical placeinside a phone or desktop appon a server and in panels

The configs are not interchangeable: the same connection is described differently in the two engines. An app with both engines therefore keeps its own settings model and translates it into the format of the chosen engine.

Common mistakes

  • Configs from old versions. sing-box changes its config format between versions, and an old file can stop being accepted. The engine version and the config generator are updated together.
  • TUN without exclusions. If the tunnel server's own address is not excluded, the connection to it tries to go through the tunnel itself and loops.
  • DNS outside the tunnel. Rules for addresses are set up, but name resolution still goes through the provider's DNS; DNS rules are set together with routing rules.
  • Stale rule sets. Lists that are never refreshed slowly drift from reality.
  • Old systems. Fresh builds of Go-based engines may not start on outdated operating systems; this is checked before promising support.

When you do not need it

If one protocol and one platform are enough, a dedicated client such as the official WireGuard app is simpler. A second engine in an app is extra code and testing; it pays off when there are many protocols or a need for a fallback.

โ† All terms

Need a website, a bot or automation?

Terms explained โ€” now let's get to work: tell us about the task and we'll turn it into a clear work plan.