@overpod/mcp-telegram 1.36.5 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +12 -0
- package/dist/telegram-client.js +14 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.37.0] — 2026-06-04
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `TELEGRAM_USE_WSS` env-var. When set to `true`, gramJS uses port `443` instead of the default `80` for the MTProto TCPFull transport. This unblocks deployments on VPS/hosting IP ranges where outbound port `80` to Telegram DC IP blocks is dropped (anti-abuse policy on some shared-VPS providers), which otherwise hangs the client forever in `Connecting to ...:80/TCPFull...`. Default is `false`, so existing setups are unaffected. Contributed by Ivan Ponomarev (@Baho73).
|
|
13
|
+
- When `TELEGRAM_USE_WSS=true` is combined with `TELEGRAM_PROXY_*` (which gramJS cannot do — SSL transport over a proxy is unsupported), the conflict is now detected early: a clear warning is logged and `useWSS` is ignored, letting the proxy take precedence, instead of crashing deep inside `connect()`.
|
|
14
|
+
|
|
8
15
|
## [1.36.5] — 2026-06-01
|
|
9
16
|
|
|
10
17
|
### Changed
|
package/README.md
CHANGED
|
@@ -128,6 +128,18 @@ npx @overpod/mcp-telegram
|
|
|
128
128
|
| `TELEGRAM_PROXY_USERNAME` | Optional proxy auth |
|
|
129
129
|
| `TELEGRAM_PROXY_PASSWORD` | Optional proxy auth |
|
|
130
130
|
|
|
131
|
+
### Connecting via WSS (port 443)
|
|
132
|
+
|
|
133
|
+
If your VPS or hosting IP is reachable on outbound port `443` but not the default MTProto port `80` (some cloud providers ban port `80` on Telegram DC IP ranges as anti-abuse policy), set:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
TELEGRAM_USE_WSS=true npx @overpod/mcp-telegram
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
| Variable | Description |
|
|
140
|
+
|----------|-------------|
|
|
141
|
+
| `TELEGRAM_USE_WSS` | When `true`, gramJS uses port `443` instead of `80` for the MTProto TCPFull transport. Default: `false`. Cannot be combined with `TELEGRAM_PROXY_*` (gramJS limitation) — if both are set, `useWSS` is ignored and the proxy takes precedence (a warning is logged). |
|
|
142
|
+
|
|
131
143
|
## Installation Options
|
|
132
144
|
|
|
133
145
|
### npx (recommended, zero install)
|
package/dist/telegram-client.js
CHANGED
|
@@ -40,6 +40,18 @@ function resolveProxy() {
|
|
|
40
40
|
...(process.env.TELEGRAM_PROXY_PASSWORD && { password: process.env.TELEGRAM_PROXY_PASSWORD }),
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
+
// When true, gramJS uses port 443 instead of the default 80 for the MTProto
|
|
44
|
+
// TCPFull transport. Useful on hosts where outbound port 80 to Telegram DC IP
|
|
45
|
+
// ranges is blocked. gramJS cannot combine useWSS with a proxy, so warn early
|
|
46
|
+
// rather than let it fail deep inside connect() with an opaque error.
|
|
47
|
+
function resolveUseWSS(proxy) {
|
|
48
|
+
const useWSS = process.env.TELEGRAM_USE_WSS === "true";
|
|
49
|
+
if (useWSS && proxy) {
|
|
50
|
+
console.error("[mcp-telegram] TELEGRAM_USE_WSS=true cannot be combined with TELEGRAM_PROXY_* — gramJS does not support SSL transport over a proxy. Ignoring useWSS; the proxy takes precedence.");
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return useWSS;
|
|
54
|
+
}
|
|
43
55
|
function ensureSessionDir(filePath) {
|
|
44
56
|
const dir = dirname(filePath);
|
|
45
57
|
if (!existsSync(dir)) {
|
|
@@ -135,6 +147,7 @@ export class TelegramService {
|
|
|
135
147
|
const proxy = resolveProxy();
|
|
136
148
|
this.client = new TelegramClient(session, this.apiId, this.apiHash, {
|
|
137
149
|
connectionRetries: 5,
|
|
150
|
+
useWSS: resolveUseWSS(proxy),
|
|
138
151
|
...(proxy && { proxy }),
|
|
139
152
|
});
|
|
140
153
|
try {
|
|
@@ -246,6 +259,7 @@ export class TelegramService {
|
|
|
246
259
|
const proxy = resolveProxy();
|
|
247
260
|
const client = new TelegramClient(session, this.apiId, this.apiHash, {
|
|
248
261
|
connectionRetries: 5,
|
|
262
|
+
useWSS: resolveUseWSS(proxy),
|
|
249
263
|
...(proxy && { proxy }),
|
|
250
264
|
});
|
|
251
265
|
try {
|
package/package.json
CHANGED