[GH-ISSUE #6855] [Bug]: Share link uses the panel domain as address instead of the WS inbound's domain #4556

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

Originally created by @URT19 on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6855

Describe the bug

یک کانفیگ
VLESS WS TLS

ساختم

Image

  "streamSettings": {
    "network": "ws",
    "wsSettings": {
      "acceptProxyProtocol": false,
      "path": "/ws",
      "host": "test.domain.com",
      "headers": {},
      "heartbeatPeriod": 30
    }

ولی توی کلاینت آدرس دامین اصلی پنل رو برمیگردونه

Image

برای رفع این مشکل باید از طریق تعریف
host
اقدام کنم

How to reproduce the problem

یک اینباند با یک دامین غیر از دامین پنل بسازید

سرتیفیکت همون دامین رو هم وارد میکنم

ولی آدرس اصلی کانفیگ رو از پنل میگیره

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.10.2

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

UBUNTU24

Which parts of the panel are affected?

No response

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

None

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @URT19 on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6855 ### Describe the bug یک کانفیگ VLESS WS TLS ساختم <img width="779" height="618" alt="Image" src="https://github.com/user-attachments/assets/b1dedb84-7f53-4093-9053-be4ef2ef6b81" /> ``` "streamSettings": { "network": "ws", "wsSettings": { "acceptProxyProtocol": false, "path": "/ws", "host": "test.domain.com", "headers": {}, "heartbeatPeriod": 30 } ``` ولی توی کلاینت آدرس دامین اصلی پنل رو برمیگردونه <img width="872" height="848" alt="Image" src="https://github.com/user-attachments/assets/ffead622-5e64-41cf-9279-2348bd9a0513" /> برای رفع این مشکل باید از طریق تعریف host اقدام کنم ### How to reproduce the problem یک اینباند با یک دامین غیر از دامین پنل بسازید سرتیفیکت همون دامین رو هم وارد میکنم ولی آدرس اصلی کانفیگ رو از پنل میگیره ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.10.2 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system UBUNTU24 ### Which parts of the panel are affected? _No response_ ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? None ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:40:29 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@github-actions[bot] commented on GitHub (Oct 16, 2026):

این رفتار باگ نیست. فیلد host در تنظیمات WebSocket (و همین‌طور SNI در TLS) فقط هدر/نام سرور است و پنل هیچ‌وقت آن را به‌عنوان آدرس اتصال لینک استفاده نمی‌کند. آدرس لینک از گزینهٔ «راهبرد آدرس اشتراک‌گذاری» اینباند تعیین می‌شود و اگر چیزی تنظیم نشده باشد، به دامنهٔ پنل/ساب برمی‌گردد — همان چیزی که شما دیدید.

(تصاویر را نمی‌توانم باز کنم؛ این تحلیل بر اساس متن و JSON گزارش است. عنوان قبلی «عدم جایگذاری درست host» را برای روشن‌تر شدن مشکل اصلاح کردم.)

راه‌حل — در فرم ویرایش اینباند:

  1. «راهبرد آدرس اشتراک‌گذاری» را روی «سفارشی» بگذارید.
  2. در «آدرس اشتراک‌گذاری سفارشی» دامنه را بدون طرح و پورت وارد کنید، مثلاً:
    test.domain.com
    
  3. ذخیره کنید؛ لینک، QR و خروجی ساب از این آدرس استفاده می‌کنند.

راه‌های دیگر: گذاشتن همین دامنه در فیلد listen اینباند همراه با راهبرد «آدرس شنود ورودی»، یا External Proxy، یا تعریف یک Host برای این اینباند (همان روشی که خودتان پیدا کردید).

Verdict: Not a bug (user configuration)
Severity: N/A
Confidence: High
Root cause: None — the share-link address never comes from wsSettings.host or the TLS SNI; with no node/listen/custom address set, resolveInboundAddress falls back to the configured Sub/Web domain, then the request host.
Same class: None found
Already fixed: Not applicable
Duplicate of: None
Evidence:

  • internal/sub/service.go:1671-1686 — candidates are only node / listen / custom, then the panel domain:
    candidates := []string{nodeAddr, listenAddr}
    switch inbound.ShareAddrStrategy {
    ...
    case "custom":
        candidates = []string{strings.TrimSpace(inbound.ShareAddr), nodeAddr, listenAddr}
    }
    ...
    if d := s.configuredPublicHost(); d != "" {
        return d
    }
    return s.address
    
  • internal/sub/service.go:263-270 — configuredPublicHost returns GetSubDomain() then GetWebDomain(): this is the "main panel domain" the reporter sees.
  • internal/sub/service.go:1751-1753 — the WS host is written only as the link's host parameter (applyPathAndHostParams(ws, params)), not the address.
  • frontend/src/lib/xray/inbound-link.ts:1346-1353 — the panel's copy/QR link uses the same order (customAddr || nodeAddr || listenAddr || fallbackAddr for custom).
  • frontend/src/pages/inbounds/form/InboundFormModal.tsx:678-705 — the shareAddrStrategy / shareAddr fields in the inbound form.
    Not determined: None

این پاسخ به‌صورت خودکار تولید شده است؛ ممکن است نگه‌دارنده بعداً پیگیری کند.

<!-- gh-comment-id:6213638011 --> @github-actions[bot] commented on GitHub (Oct 16, 2026): این رفتار باگ نیست. فیلد `host` در تنظیمات WebSocket (و همین‌طور SNI در TLS) فقط هدر/نام سرور است و پنل هیچ‌وقت آن را به‌عنوان **آدرس اتصال** لینک استفاده نمی‌کند. آدرس لینک از گزینهٔ «راهبرد آدرس اشتراک‌گذاری» اینباند تعیین می‌شود و اگر چیزی تنظیم نشده باشد، به دامنهٔ پنل/ساب برمی‌گردد — همان چیزی که شما دیدید. (تصاویر را نمی‌توانم باز کنم؛ این تحلیل بر اساس متن و JSON گزارش است. عنوان قبلی «عدم جایگذاری درست host» را برای روشن‌تر شدن مشکل اصلاح کردم.) **راه‌حل** — در فرم ویرایش اینباند: 1. «راهبرد آدرس اشتراک‌گذاری» را روی «سفارشی» بگذارید. 2. در «آدرس اشتراک‌گذاری سفارشی» دامنه را بدون طرح و پورت وارد کنید، مثلاً: ``` test.domain.com ``` 3. ذخیره کنید؛ لینک، QR و خروجی ساب از این آدرس استفاده می‌کنند. راه‌های دیگر: گذاشتن همین دامنه در فیلد `listen` اینباند همراه با راهبرد «آدرس شنود ورودی»، یا External Proxy، یا تعریف یک Host برای این اینباند (همان روشی که خودتان پیدا کردید). Verdict: Not a bug (user configuration) Severity: N/A Confidence: High Root cause: None — the share-link address never comes from `wsSettings.host` or the TLS SNI; with no node/listen/custom address set, `resolveInboundAddress` falls back to the configured Sub/Web domain, then the request host. Same class: None found Already fixed: Not applicable Duplicate of: None Evidence: - `internal/sub/service.go:1671-1686` — candidates are only node / listen / custom, then the panel domain: ```go candidates := []string{nodeAddr, listenAddr} switch inbound.ShareAddrStrategy { ... case "custom": candidates = []string{strings.TrimSpace(inbound.ShareAddr), nodeAddr, listenAddr} } ... if d := s.configuredPublicHost(); d != "" { return d } return s.address ``` - `internal/sub/service.go:263-270` — `configuredPublicHost` returns `GetSubDomain()` then `GetWebDomain()`: this is the "main panel domain" the reporter sees. - `internal/sub/service.go:1751-1753` — the WS `host` is written only as the link's `host` parameter (`applyPathAndHostParams(ws, params)`), not the address. - `frontend/src/lib/xray/inbound-link.ts:1346-1353` — the panel's copy/QR link uses the same order (`customAddr || nodeAddr || listenAddr || fallbackAddr` for `custom`). - `frontend/src/pages/inbounds/form/InboundFormModal.tsx:678-705` — the `shareAddrStrategy` / `shareAddr` fields in the inbound form. Not determined: None _این پاسخ به‌صورت خودکار تولید شده است؛ ممکن است نگه‌دارنده بعداً پیگیری کند._ <!-- claude-issue:analyst -->
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#4556
No description provided.