feat(notify): add proxy support for Telegram notifications#14
Open
whhphd wants to merge 1 commit intoNarcooo:masterfrom
Open
feat(notify): add proxy support for Telegram notifications#14whhphd wants to merge 1 commit intoNarcooo:masterfrom
whhphd wants to merge 1 commit intoNarcooo:masterfrom
Conversation
Telegram API (api.telegram.org) is blocked in some regions (e.g. China).
This adds optional proxy support so users can send notifications via a
local proxy without requiring system-wide TUN/VPN.
Changes:
- Add optional `proxy` field to Telegram notify channel schema
- Use undici ProxyAgent when proxy is configured
- Fall back to HTTPS_PROXY/HTTP_PROXY environment variables
- Add undici as explicit dependency (bundled in Node 20+ but needed for types)
Usage in inkos.json:
{
"type": "telegram",
"botToken": "...",
"chatId": "...",
"proxy": "http://127.0.0.1:7890"
}
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
proxyfield to Telegram notify channel configundici.ProxyAgentto route Telegram API requests through a proxyHTTPS_PROXY/HTTP_PROXYenvironment variables whenproxyis not set in configMotivation
Telegram API (
api.telegram.org) is blocked in some regions (e.g. China). Users currently have no way to configure a proxy for Telegram notifications without system-wide TUN/VPN, which may interfere with other services (e.g. LLM API endpoints on internal networks).Usage
{ "type": "telegram", "botToken": "...", "chatId": "...", "proxy": "http://127.0.0.1:7890" }The
proxyfield is optional. When omitted, the code checksHTTPS_PROXY/HTTP_PROXYenv vars. If none is set, fetch proceeds without a proxy (existing behavior).Changes
packages/core/src/models/project.ts— Add optionalproxyto Telegram schemapackages/core/src/notify/telegram.ts— Importundici.ProxyAgent, apply when proxy is configuredpackages/core/src/notify/dispatcher.ts— Passchannel.proxytosendTelegrampackages/core/package.json— Addundicidependency (bundled in Node 20+ but needed for TypeScript types)Test plan
tsc --noEmitpassesvitest run)http://127.0.0.1:7890proxy🤖 Generated with Claude Code