[GH-ISSUE #5019] [Question]: inbounds configuration #3534

Closed
opened 2026-10-31 20:33:07 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @RezaHaghgoo on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5019

What are you trying to do?

For creating reverse tunnel, is it correct ?:
on Iran server, we should create 2 inbounds. one for tunnel and another one for users.
settings of tunnel inbound: Protocol = vless, Port = 443, Transmission = ws, Host = [our panel domain], Security = TLS, SNI = [our panel domain].
settings of users inbound: (all same as tunnel inbound but) Port = 8443

What have you already tried?

No response

3x-ui version

3.2.8

How did you install 3x-ui?

install.sh script

Operating system

No response

Screenshots or config snippets

No response

Before submitting

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
Originally created by @RezaHaghgoo on GitHub (Jun 6, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5019 ### What are you trying to do? For creating reverse tunnel, is it correct ?: on Iran server, we should create 2 inbounds. one for tunnel and another one for users. settings of tunnel inbound: Protocol = vless, Port = 443, Transmission = ws, Host = [our panel domain], Security = TLS, SNI = [our panel domain]. settings of users inbound: (all same as tunnel inbound but) Port = 8443 ### What have you already tried? _No response_ ### 3x-ui version 3.2.8 ### How did you install 3x-ui? install.sh script ### Operating system _No response_ ### Screenshots or config snippets _No response_ ### Before submitting - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
bsakaguchi 2026-10-31 20:33:07 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jun 6, 2026):

The configuration you described is not quite right for a reverse tunnel. The core issue is that an inbound is a listener — it accepts incoming connections but cannot initiate an outgoing tunnel to another server. Here is what each approach actually requires:


Option A — Simple transparent relay (Dokodemo-door / "Tunnel" protocol)

This is the simplest approach. On the Iran server you need one inbound only — no separate users inbound.

  1. Create a new inbound on the Iran server:
    • Protocol: Tunnel (this is 3x-ui's wrapper around Xray's dokodemo-door)
    • Port: any port users will connect to (e.g. 443)
    • In Settings, set Rewrite Address to your foreign server's IP/domain and Rewrite Port to the port your foreign server's VLESS inbound listens on.
  2. Users connect to <iran-server-ip>:443 and traffic is transparently forwarded to the foreign server.
  3. The foreign server processes it as if the user connected directly.

No VLESS configuration is needed on the Iran server at all with this approach.


Option B — Xray reverse proxy (bridge/portal)

For Xray's built-in reverse proxy the Iran server must create an outbound (not a second inbound) to connect to the foreign server. Here is the correct layout:

Foreign server (portal):

  1. Create a VLESS inbound (e.g. port 443, WS+TLS) — this is where the Iran bridge connects in.
  2. Add routing rules to forward traffic from the bridge back to its destination.

Iran server (bridge):

  1. Create a VLESS inbound for users (e.g. port 8443) — this is correct.
  2. In Outbounds (not Inbounds), create a VLESS outbound pointing to the foreign server (port 443, WS+TLS, Host = panel domain, SNI = panel domain). In the client settings for that outbound, set the Reverse Tag field (e.g. bridge-tag). This is the reverse.tag field exposed by 3x-ui on VLESS clients (GetClientReverseTags in the panel collects these for routing).
  3. Add a routing rule: traffic from the reverse inbound tag (bridge-tag) → Freedom outbound.

The "tunnel inbound" you described (VLESS port 443 WS+TLS pointing to your panel domain) does not create an outgoing connection — that is exactly what the outbound in step 2 above does.


Summary of what was wrong: the "tunnel inbound" should be either a Tunnel-protocol inbound (Option A) or a VLESS outbound (Option B), not a second VLESS inbound.

For a detailed step-by-step walkthrough with screenshots, the maintainer has asked that configuration questions be continued in GitHub Discussions rather than Issues.

<!-- gh-comment-id:4639562926 --> @github-actions[bot] commented on GitHub (Jun 6, 2026): The configuration you described is not quite right for a reverse tunnel. The core issue is that an **inbound** is a listener — it accepts incoming connections but cannot initiate an outgoing tunnel to another server. Here is what each approach actually requires: --- ## Option A — Simple transparent relay (Dokodemo-door / "Tunnel" protocol) This is the simplest approach. On the Iran server you need **one** inbound only — no separate users inbound. 1. Create a new inbound on the Iran server: - **Protocol: Tunnel** (this is 3x-ui's wrapper around Xray's `dokodemo-door`) - **Port**: any port users will connect to (e.g. `443`) - In **Settings**, set **Rewrite Address** to your foreign server's IP/domain and **Rewrite Port** to the port your foreign server's VLESS inbound listens on. 2. Users connect to `<iran-server-ip>:443` and traffic is transparently forwarded to the foreign server. 3. The foreign server processes it as if the user connected directly. No VLESS configuration is needed on the Iran server at all with this approach. --- ## Option B — Xray reverse proxy (bridge/portal) For Xray's built-in reverse proxy the Iran server must create an **outbound** (not a second inbound) to connect to the foreign server. Here is the correct layout: **Foreign server (portal):** 1. Create a VLESS inbound (e.g. port 443, WS+TLS) — this is where the Iran bridge connects in. 2. Add routing rules to forward traffic from the bridge back to its destination. **Iran server (bridge):** 1. Create a VLESS inbound for **users** (e.g. port 8443) — this is correct. 2. In **Outbounds** (not Inbounds), create a VLESS outbound pointing to the foreign server (port 443, WS+TLS, Host = panel domain, SNI = panel domain). In the client settings for that outbound, set the **Reverse Tag** field (e.g. `bridge-tag`). This is the `reverse.tag` field exposed by 3x-ui on VLESS clients (`GetClientReverseTags` in the panel collects these for routing). 3. Add a routing rule: traffic from the reverse inbound tag (`bridge-tag`) → Freedom outbound. The "tunnel inbound" you described (VLESS port 443 WS+TLS pointing to your panel domain) does not create an outgoing connection — that is exactly what the outbound in step 2 above does. --- **Summary of what was wrong:** the "tunnel inbound" should be either a **Tunnel-protocol inbound** (Option A) or a **VLESS outbound** (Option B), not a second VLESS inbound. For a detailed step-by-step walkthrough with screenshots, the maintainer has asked that configuration questions be continued in **[GitHub Discussions](https://github.com/MHSanaei/3x-ui/discussions)** rather than Issues.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3534
No description provided.