Skip to content

Reverse

The reverse block sets up reverse-tunnel hops — a Bridge on the destination side waits for control connections from a Portal at the ingress side, then routes user traffic through the established tunnel.

Top-level

FieldTypeDefaultAllowed valuesDescription
bridges[]BridgeConfig[]BridgeBridges placed at the destination side of a reverse-proxy tunnel.
portals[]PortalConfig[]PortalPortals placed at the entry side of a reverse-proxy tunnel.

Source: infra/conf/reverse.go:32-35 · pinned at v26.6.1 (94ffd50)

Bridge

FieldTypeDefaultAllowed valuesDescription
tagstring(required)<tag>Routing tag for this bridge.
domainstring(required)<domain>Shared domain used to match the matching portal at the other end.

Source: infra/conf/reverse.go:8-11 · pinned at v26.6.1 (94ffd50)

Portal

FieldTypeDefaultAllowed valuesDescription
tagstring(required)<tag>Routing tag for this portal.
domainstring(required)<domain>Shared domain used to bind to the matching bridge.

Source: infra/conf/reverse.go:20-23 · pinned at v26.6.1 (94ffd50)

Example sketch

json
// On the destination-side server (the one that can reach the internal target):
{
  "reverse": {
    "bridges": [{ "tag": "bridge", "domain": "tunnel.example.com" }]
  },
  "outbounds": [
    { "tag": "tunnel", "protocol": "freedom" }
  ]
}

// On the ingress server (the one users connect to):
{
  "reverse": {
    "portals": [{ "tag": "portal", "domain": "tunnel.example.com" }]
  },
  "outbounds": [
    { "tag": "portal-out", "protocol": "vless", "settings": { /* ... */ } }
  ]
}

Notes

  • The domain value on a bridge and its matching portal must be byte-for- byte identical. Xray uses it as an internal "rendezvous name" — it is never resolved over DNS.
  • Reverse tunnels are pairs of routing tags; the routing rules on each side decide which traffic enters or leaves the tunnel.

Source: infra/conf/reverse.go:8-35 · v26.6.1 (94ffd50)

Core Tutorial by Argsment