Skip to content

Interop: tests/interop ​

On-the-wire compatibility with sing-box: our client against their server, their client against ours and ours against ours. Loopback only; the built binaries of both are needed.

Contents ​

  • pair.py — one configuration description (Entity: kind, port, TLS, detour, transport, mux, format-specific members), written out both as sing-box JSON and as our YAML (write). The protocol members are the same in both formats, the wrapping differs. INTEROP_LOG=trace — the full log of a failed case (debug by default).
  • vless_singbox.py — VLESS and sing-mux: parallel TCP/UDP, repeated streams, packet addresses, transports, TLS/REALITY (keys — sing-box generate reality-keypair), a SOCKS detour. Certificates — modules/system/tls/tests/data. Flags: --quick (only sing-mux over TCP), --udp-only, --socks-only, --match <text>, --start-at <label> (continue from the failed case).
  • protocols_singbox.py — anytls, shadowtls, hysteria, hysteria2, tuic, trojan and shadowsocks with sing-mux and UoT, the Shadowsocks plugins (ss-plugin). Each case: a client with a SOCKS inbound and a server that hands off to direct; the directions ours-to-go, go-to-ours, ours-to-ours; eight streams twice — a 128 KiB TCP echo and UDP datagrams of 1, 1200 and 9000 bytes. The TCP Brutal cases (brutal, brutal-off) expect the server to refuse and check the reason in the client's log: there is no tcp-brutal kernel module on the bench. Plugins: the obfs-local server is the emulator obfs_server.py (simple-obfs obfs-server), the v2ray-plugin server is its binary (--v2ray-plugin, without it the cases are skipped). --match <text>.
  • vless_xray_mux.py — Xray's mux.cool over VLESS against Xray (--xray): TCP and UDP up to 8 KiB (Xray's mux.cool carries no more); the Xray server must see v1.mux.cool.

Running ​

sh
cargo build -p ours
python3 tests/run.py -- python3 tests/interop/vless_singbox.py \
  --ours "${CARGO_TARGET_DIR:-target}/debug/ours" --sing-box <path to sing-box 1.14.4>
python3 tests/run.py -- python3 tests/interop/protocols_singbox.py \
  --ours "${CARGO_TARGET_DIR:-target}/debug/ours" --sing-box <path to sing-box 1.14.4> \
  --v2ray-plugin <path to v2ray-plugin>
python3 tests/run.py -- python3 tests/interop/vless_xray_mux.py \
  --ours "${CARGO_TARGET_DIR:-target}/debug/ours" --xray <path to xray>

v2ray-plugin is built from a fork with modern dependencies (github.com/teddysun/v2ray-plugin, go build): v1.3.2 of shadowsocks/v2ray-plugin has an old quic-go and crashes on new Go versions. Its server accepts only mux.cool: with mux=0 the sing-box client does not work either.

Take the sing-box binary of the verified version (1.14.4), not whatever is in PATH; benchlab keeps downloaded cores in its cores/<core>/<version>/.

Relation to benchlab ​

Compatibility with Xray and the full "client core → server core" matrix across all protocols, transports and network presets is benchlab in --mode compat (see Benchmarks). tests/interop remains a quick targeted run against sing-box without namespaces and sudo.

GPL-3.0-or-later