[GH-ISSUE #5373] [Feature]: Operation of telegram notifications of the panel through the selected outbound #3761

Closed
opened 2026-10-31 20:34:46 +07:00 by bsakaguchi · 2 comments
Owner

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

In some countries, Telegram is blocked by shameful services

Describe the solution you'd like

In the settings of telegram notifications, the label directs traffic through and in the drop-down list of options "direct, list of outbounds"

Alternatives you've considered

No response

Concrete use case

No response

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

No response

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @MiraMaX166 on GitHub (Jun 16, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5373 ### Is your feature request related to a problem? In some countries, Telegram is blocked by shameful services ### Describe the solution you'd like In the settings of telegram notifications, the label directs traffic through and in the drop-down list of options "direct, list of outbounds" ### Alternatives you've considered _No response_ ### Concrete use case _No response_ ### Mockups, screenshots, or examples _No response_ ### Which parts of the panel would this affect? _No response_ ### Are you willing to help? - [x] I'd like to implement this feature myself and open a PR. - [x] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
bsakaguchi 2026-10-31 20:34:46 +07:00
Author
Owner

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

The core of this request — routing Telegram bot traffic through an Xray outbound on a server where Telegram is blocked — is already implemented via the Panel Traffic Outbound setting.

What currently exists

Settings → General → Panel Traffic Outbound (panelOutbound) accepts any outbound tag from your Xray config (including balancer tags). When set, the panel automatically injects a loopback SOCKS bridge into the running Xray config and routes all panel-originated outbound requests through it, explicitly including Telegram bot traffic. This is confirmed in:

  • internal/web/service/setting.go — GetPanelOutbound() / PanelEgressProxyURL() (lines 417–450): resolves the tag to a socks5://127.0.0.1:<port> address pointing to the injected bridge.
  • internal/web/service/tgbot/tgbot.go (lines 244–248): the bot falls back to PanelEgressProxyURL() when no dedicated tgBotProxy value is set.
  • internal/web/translation/en-US.json (line 1006): the setting description reads: "Routes the panel's own requests — panel/Xray version checks and downloads, Telegram, and the normal geo-file update — through this Xray outbound …"

The loopback bridge is applied live; no restart is required after saving.

How to use it now

  1. In your Xray config, ensure you have an outbound tag whose routing can reach api.telegram.org (e.g. a VLESS/VMess/Shadowsocks outbound pointing to a server outside the filtered country, or a WARP outbound).
  2. Go to Settings → General → Panel Traffic Outbound and select that outbound tag from the dropdown.
  3. Save. The change is applied live.

What this request adds beyond the current feature

Your specific proposal — a dedicated outbound picker inside the Telegram bot settings section — would give per-feature granularity (Telegram outbound independently from other panel traffic such as update checks and geo downloads). That is a valid incremental enhancement on top of the existing mechanism. The existing infrastructure (injectPanelEgress, PanelEgressProxyURL, the telego bot's proxy plumbing) already provides a clear path to implement this: it would need a new tgBotOutbound setting, a corresponding UI control in the Telegram bot settings page, and a lookup in tgbot.Start() that calls PanelEgressProxyURL() with that tag before falling back to the panel-wide one.

Related prior issues for context: #5058 (closed — routed to same existing feature), #4718, #4102.

Since you indicated you would like to implement this yourself, the above should give you a concrete starting point.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4715007993 --> @github-actions[bot] commented on GitHub (Jun 16, 2026): The core of this request — routing Telegram bot traffic through an Xray outbound on a server where Telegram is blocked — is already implemented via the **Panel Traffic Outbound** setting. **What currently exists** `Settings → General → Panel Traffic Outbound` (`panelOutbound`) accepts any outbound tag from your Xray config (including balancer tags). When set, the panel automatically injects a loopback SOCKS bridge into the running Xray config and routes all panel-originated outbound requests through it, explicitly including Telegram bot traffic. This is confirmed in: - `internal/web/service/setting.go` — `GetPanelOutbound()` / `PanelEgressProxyURL()` (lines 417–450): resolves the tag to a `socks5://127.0.0.1:<port>` address pointing to the injected bridge. - `internal/web/service/tgbot/tgbot.go` (lines 244–248): the bot falls back to `PanelEgressProxyURL()` when no dedicated `tgBotProxy` value is set. - `internal/web/translation/en-US.json` (line 1006): the setting description reads: *"Routes the panel's own requests — panel/Xray version checks and downloads, **Telegram**, and the normal geo-file update — through this Xray outbound …"* The loopback bridge is applied live; no restart is required after saving. **How to use it now** 1. In your Xray config, ensure you have an outbound tag whose routing can reach `api.telegram.org` (e.g. a VLESS/VMess/Shadowsocks outbound pointing to a server outside the filtered country, or a WARP outbound). 2. Go to **Settings → General → Panel Traffic Outbound** and select that outbound tag from the dropdown. 3. Save. The change is applied live. **What this request adds beyond the current feature** Your specific proposal — a dedicated outbound picker inside the Telegram bot settings section — would give per-feature granularity (Telegram outbound independently from other panel traffic such as update checks and geo downloads). That is a valid incremental enhancement on top of the existing mechanism. The existing infrastructure (`injectPanelEgress`, `PanelEgressProxyURL`, the `telego` bot's proxy plumbing) already provides a clear path to implement this: it would need a new `tgBotOutbound` setting, a corresponding UI control in the Telegram bot settings page, and a lookup in `tgbot.Start()` that calls `PanelEgressProxyURL()` with that tag before falling back to the panel-wide one. Related prior issues for context: #5058 (closed — routed to same existing feature), #4718, #4102. Since you indicated you would like to implement this yourself, the above should give you a concrete starting point. *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@MiraMaX166 commented on GitHub (Jun 16, 2026):

Да, прошу прощения. Проглядел.

<!-- gh-comment-id:4715157247 --> @MiraMaX166 commented on GitHub (Jun 16, 2026): Да, прошу прощения. Проглядел.
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#3761
No description provided.