Configuration contracts
Xray JSON import formats
These are OneXray import contracts, not interchangeable names for a generic Xray configuration. Essential rules are on this site; reading App source is not required to use the documented formats.
Read / download the full guide · AI reading index · Markdown for this page
| Document | Root / content | Import entry | What remains in the App |
|---|---|---|---|
| Outbound | outbounds containing actual proxy objects; a single editor accepts exactly one |
Servers → Add server → Manual JSON; file/text import can extract several nodes | Server selection, routing and Tunnel |
| Custom Routing | name, empty outbounds slots, routing, optional dns and import dependencies |
Connect → traffic method → Custom Routing → import | Actual servers, proxy balancer and Tunnel |
| Advanced Custom | name, 1–3 leading empty slots, optional auxiliary outbounds, user DNS/rules/inbounds |
Custom Routing → Advanced JSON → import or editor | Actual servers, fixed proxy balancer, direct/block, platform settings |
| Raw JSON | name and complete user-owned Xray configuration |
Connect → expert mode → Raw JSON → import or editor | Managed Tunnel settings, logs, metrics, DNS query policy and applicable interface |
| VPN Tunnel | No import document | Advanced → VPN Tunnel | Platform settings are saved through the UI |
The ordinary Servers import extracts only outbounds. It does not install a root-level routing or DNS configuration. Do not offer a Raw file through that entry.
Generation rules
- Choose exactly one import type for each file. Use UTF-8 strict JSON: no comments, trailing commas, ellipses or Markdown inside the file.
- Include a useful root
namefor Custom/Raw; use the outbound’stagfor a node name. Do not usesendThroughfor display text. - Generate complete files, not patches or isolated rule arrays. Never add documentation metadata to a configuration; metadata belongs in the example manifest.
- Use only fields accepted by the chosen mode and target version. Unsupported Custom fields are errors, not harmless hints.
- Document dependencies and placeholders before calling anything ready to import. Existing server count and storage capacity are prerequisites.
- Validate through the App import/save path. Custom empty slots are not executable Xray outbounds: passing that file directly to the standalone Core is the wrong test.
Reading order
Compatibility → the chosen format → DNS → Geodata → recipes → Tunnel guidance → verification and errors.
App links and sharing describe optional transport envelopes. A plain JSON file is simpler for AI output; do not Base64-encode it unless constructing an App Link.
Last updated on