[GH-ISSUE #5782] [Question]: Proxy for telegram test message #4022

Closed
opened 2026-10-31 20:36:36 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @pythonfree on GitHub (Jul 4, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5782

What are you trying to do?

Hello! How can I set up a proxy to send test messages to Telegram? Previously, this feature was available, but it disappeared on June 24, 2026.

What have you already tried?

No response

3x-ui version

3.4.2

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

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 @pythonfree on GitHub (Jul 4, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5782 ### What are you trying to do? Hello! How can I set up a proxy to send test messages to Telegram? Previously, this feature was available, but it disappeared on June 24, 2026. ### What have you already tried? _No response_ ### 3x-ui version 3.4.2 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### 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.
Author
Owner

@pythonfree commented on GitHub (Jul 4, 2026):

"Тест Telegram не удался: telegram API test failed: API unreachable: telego: getMe: internal execution: request call: fasthttp do request: error when dialing 149.154.166.110:443: dialing to the given TCP address timed out (telegram API test failed: API unreachable: telego: getMe: internal execution: request call: fasthttp do request: error when dialing 149.154.166.110:443: dialing to the given TCP address timed out)"

<!-- gh-comment-id:4881412400 --> @pythonfree commented on GitHub (Jul 4, 2026): "Тест Telegram не удался: telegram API test failed: API unreachable: telego: getMe: internal execution: request call: fasthttp do request: error when dialing 149.154.166.110:443: dialing to the given TCP address timed out (telegram API test failed: API unreachable: telego: getMe: internal execution: request call: fasthttp do request: error when dialing 149.154.166.110:443: dialing to the given TCP address timed out)"
Author
Owner

@github-actions[bot] commented on GitHub (Jul 4, 2026):

The dedicated raw Telegram-bot proxy field is gone from the Settings → Telegram tab, but the feature to route the bot (including the Send Test Message button) through a proxy is still there, just moved. Here is what I confirmed in the current (v3.4.2) source:

1. Where the proxy setting lives now

frontend/src/pages/settings/TelegramTab.tsx only exposes token, chat ID, language, API server and the test button — no proxy input. The replacement is Settings → General → "Panel Traffic Outbound" (panelOutbound). Its description confirms it covers Telegram:

Routes the panel's own requests — panel/Xray version checks and downloads, Telegram, and the normal geo-file update — through this Xray outbound to bypass server-side filtering of GitHub/Telegram.

To use it:

  1. Add an outbound that reaches Telegram (e.g. a relay you control) to your Xray config template's outbounds array, and give it a tag.
  2. Go to Settings → General → Panel Traffic Outbound and select that tag. Save.

This makes the panel inject a loopback SOCKS5 bridge into the running Xray config and route the Telegram bot's HTTP client through it whenever the bot's own tgBotProxy value is empty (confirmed in internal/web/service/setting.go PanelEgressProxyURL() and the fallback logic in internal/web/service/tgbot/tgbot.go, lines ~293-306).

2. Important: a Settings "Save" is not enough

The bot only re-reads its proxy when it (re)starts. Saving settings now auto-reloads the bot (added in commit 93ff60e5), but only when tgBotEnable, the token, chat ID, or API server changed (internal/web/controller/setting.go, lines ~134-141) — a panelOutbound or tgBotProxy change is not in that list. So after configuring the outbound, you need a full panel restart (x-ui menu → restart, or systemctl restart x-ui) before the bot picks it up.

3. Setting a raw proxy URL directly (if you don't want to route all panel traffic)

The backend still fully supports a dedicated tgBotProxy value (socks5://, http://, or https://, checked in isSupportedBotProxyScheme() in tgbot.go) and it takes priority over panelOutbound when both are set — there is just no UI field for it. You can set it directly and restart:

sqlite3 /etc/x-ui/x-ui.db "UPDATE settings SET value = 'socks5://127.0.0.1:1080' WHERE key = 'tgBotProxy';"
systemctl restart x-ui

4. About "Send Test Message"

After restarting, use the Send Test Message button on the Telegram tab. It genuinely sends a real message to your configured chat ID (SendMsgToTgbotAdmins("✅ Test message from 3x-ui"), wired in internal/web/web.go), so it will confirm whether the proxy path actually works.

I could not find a commit that removed a dedicated Telegram-proxy UI field specifically on June 24 — the TelegramTab.tsx already had no such field before that date (confirmed by diffing PR #5326, merged June 15, which only added the test button). If you were looking at a specific screen that had a proxy field, a screenshot or the exact panel version where you last saw it would help pin down which release that was.

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

<!-- gh-comment-id:4881418332 --> @github-actions[bot] commented on GitHub (Jul 4, 2026): The dedicated raw Telegram-bot proxy field is gone from the Settings → Telegram tab, but the feature to route the bot (including the **Send Test Message** button) through a proxy is still there, just moved. Here is what I confirmed in the current (v3.4.2) source: **1. Where the proxy setting lives now** `frontend/src/pages/settings/TelegramTab.tsx` only exposes token, chat ID, language, API server and the test button — no proxy input. The replacement is **Settings → General → "Panel Traffic Outbound"** (`panelOutbound`). Its description confirms it covers Telegram: > Routes the panel's own requests — panel/Xray version checks and downloads, Telegram, and the normal geo-file update — through this Xray outbound to bypass server-side filtering of GitHub/Telegram. To use it: 1. Add an outbound that reaches Telegram (e.g. a relay you control) to your Xray config template's `outbounds` array, and give it a tag. 2. Go to **Settings → General → Panel Traffic Outbound** and select that tag. Save. This makes the panel inject a loopback SOCKS5 bridge into the running Xray config and route the Telegram bot's HTTP client through it whenever the bot's own `tgBotProxy` value is empty (confirmed in `internal/web/service/setting.go` `PanelEgressProxyURL()` and the fallback logic in `internal/web/service/tgbot/tgbot.go`, lines ~293-306). **2. Important: a Settings "Save" is not enough** The bot only re-reads its proxy when it (re)starts. Saving settings now auto-reloads the bot (added in commit `93ff60e5`), but only when `tgBotEnable`, the token, chat ID, or API server changed (`internal/web/controller/setting.go`, lines ~134-141) — a `panelOutbound` or `tgBotProxy` change is **not** in that list. So after configuring the outbound, you need a full panel restart (`x-ui` menu → restart, or `systemctl restart x-ui`) before the bot picks it up. **3. Setting a raw proxy URL directly (if you don't want to route all panel traffic)** The backend still fully supports a dedicated `tgBotProxy` value (`socks5://`, `http://`, or `https://`, checked in `isSupportedBotProxyScheme()` in `tgbot.go`) and it takes priority over `panelOutbound` when both are set — there is just no UI field for it. You can set it directly and restart: ```bash sqlite3 /etc/x-ui/x-ui.db "UPDATE settings SET value = 'socks5://127.0.0.1:1080' WHERE key = 'tgBotProxy';" systemctl restart x-ui ``` **4. About "Send Test Message"** After restarting, use the **Send Test Message** button on the Telegram tab. It genuinely sends a real message to your configured chat ID (`SendMsgToTgbotAdmins("✅ Test message from 3x-ui")`, wired in `internal/web/web.go`), so it will confirm whether the proxy path actually works. I could not find a commit that removed a dedicated Telegram-proxy UI field specifically on June 24 — the `TelegramTab.tsx` already had no such field before that date (confirmed by diffing PR #5326, merged June 15, which only added the test button). If you were looking at a specific screen that had a proxy field, a screenshot or the exact panel version where you last saw it would help pin down which release that was. *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@pythonfree commented on GitHub (Jul 4, 2026):

Thank you, this helped me: sqlite3 /etc/x-ui/x-ui.db "INSERT INTO settings (key, value) VALUES ('tgBotProxy', 'socks5://porxylogin:proxypass@myproxyip:1080');"

<!-- gh-comment-id:4881493775 --> @pythonfree commented on GitHub (Jul 4, 2026): Thank you, this helped me: `sqlite3 /etc/x-ui/x-ui.db "INSERT INTO settings (key, value) VALUES ('tgBotProxy', 'socks5://porxylogin:proxypass@myproxyip:1080');"`
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#4022
No description provided.