A TypeScript port of the Telegram proxy configuration parser, optimized for Bun runtime.
- Parses Telegram channels for proxy configurations
- Supports multiple proxy protocols (VMess, VLess, Shadowsocks, Trojan, etc.)
- Multi-threaded parsing with configurable concurrency
- Automatic deduplication and validation
- Configuration cleanup and normalization
- Bun runtime installed
- Internet connection for fetching Telegram channel data
Install dependencies:
bun installRun the script:
bun run index.tsThe script will prompt you for:
- Number of parsing threads
- Parsing depth (1 depth = ~20 recent posts)
- Whether to include invalid channels
telegram_channels.json- Valid channels with proxy configsinvalid_channels.json- Channels without proxy configsconfig-tg.txt- Extracted and cleaned proxy configurations
- VMess (
vmess://) - VLess (
vless://) - Shadowsocks (
ss://) - Trojan (
trojan://) - TUIC (
tuic://) - Hysteria/Hysteria2 (
hysteria://,hysteria2://,hy2://) - Juicity (
juicity://) - SOCKS4/5 (
socks4://,socks5://,socks://) - Naive (
naive+) - WireGuard (
wireguard://,wg://) - And more...
This TypeScript version maintains full compatibility with the original Python script:
- Same input/output file formats
- Identical parsing logic and validation rules
- Same configuration cleaning and normalization
- Compatible threading model using async/await
The TypeScript version leverages:
- Native Bun HTTP client for faster requests
- Async/await for efficient concurrency
- Cheerio for fast HTML parsing
- Built-in JSON handling