Skip to content

How to add ​

Step-by-step instructions for typical extensions. Each relies on an existing module as a model; paths and names are from the current code.

TaskModelFile
A new module in the binary: crate, MODULE, feature, LIST, requiresany modules/*/*module.md
A protocol: inbound and/or outboundmodules/protocols/block, modules/protocols/socks, modules/protocols/trojanprotocol.md
A transport: a variant of the transport blockmodules/transports/wstransport.md
A rule condition in matchmodules/routing/rule-processrule-condition.md
A top-level sectionmodules/system/ntpsection.md
A subscription formatmodules/config/subscriptions/src/links.rssubscription-format.md

Any extension is a module or part of a module, so start with module.md: the other instructions refer to it for the build and check steps.

General rules ​

  • A module talks to the kernel only through the ours-api contract (Module, Provide, services); a module may not depend on ours-kernel — see Contract, Layers.
  • Wire behaviour must match sing-box 1.14.4 (and Xray for VLESS extensions); the YAML format is our own. Differences are described in differences.
  • After a change — the minimal set of checks from Checks: the crate's tests, tests/layers.py, tests/features.py, and for new network behaviour an E2E scenario that also passes on the reference (PROXY=sing-box).
  • The description of a new module — docs/architecture/modules/<name>.md (see Modules).

GPL-3.0-or-later