Powered by TDLib

MTProto Proxy
Health Checker

Real MTProto handshake verification โ€” not just a port scan. If it says โœ…, the proxy actually works in Telegram.

$ npm install -g mtproto-checker
๐Ÿค

Real Handshake

Uses TDLib's testProxy โ€” the same path tdesktop uses. Not a TCP ping.

๐Ÿ“ก

Flexible Input

Direct links, remote URLs, local files, or any mix โ€” auto-detected per entry.

๐Ÿ”„

Multi-Iteration

Re-check survivors across multiple rounds. Only stable proxies make the cut.

๐ŸŒ

HTTP API

Built-in server with Basic Auth. Deploy anywhere, query from anything.

๐Ÿงน

De-duplication

Auto de-duplicates by server:port:secret across all sources.

๐Ÿ”

Fake-TLS SNI

Extracts camouflage domains from ee-prefixed secrets automatically.

CLI Usage

Install globally and run from anywhere

# Check proxies from remote URLs
TG_API_ID=12345 TG_API_HASH=abcdef check-proxies \
  --url https://example.com/proxies.txt \
  --iterations 2

# Check a single proxy link
check-proxies --proxy "tg://proxy?server=1.2.3.4&port=443&secret=ee..."

# Start HTTP server (no arguments)
CHECK_AUTH_USER=admin CHECK_AUTH_PASSWORD=secret check-proxies
FlagDefaultDescription
--proxy <link>โ€”Check one proxy link directly
--url <url>โ€”Source URL (repeatable)
--sources <file>โ€”File of source URLs
--dc <1-5>2Data center for testProxy
--timeout <sec>10Per-proxy timeout
--concurrency <n>30Parallel checks
--iterations <n>1Re-check rounds
--out <prefix>resultOutput file prefix

Library API

Three functions, that's all you need

const { checkProxyLink, checkProxiesFromURIs, startServer } = require('mtproto-checker')

checkProxyLink(link, opts)

Check a single tg://proxy or https://t.me/proxy link via real MTProto handshake.

const results = await checkProxyLink(
  'tg://proxy?server=1.2.3.4&port=443&secret=ee...',
  { apiId: 12345, apiHash: 'abcdef' }
)

checkProxiesFromURIs(uris, opts)

Check proxies from remote URLs, local files, direct links, or any mix. Auto-detects and de-duplicates.

const results = await checkProxiesFromURIs([
  'tg://proxy?server=1.2.3.4&port=443&secret=ee...',
  'https://example.com/list.txt',
  './local-proxies.txt'
], { apiId: 12345, apiHash: 'abcdef', iterations: 2, concurrency: 20 })

startServer(opts)

Start the HTTP API server programmatically. All fields optional โ€” falls back to env vars.

const server = await startServer({
  apiId: 12345,
  apiHash: 'abcdef',
  user: 'admin',
  password: 'secret',
  port: 8080
})

Options Reference

KeyTypeDefaultDescription
apiIdnumberโ€”Telegram API ID
apiHashstringโ€”Telegram API Hash
dcnumber2Data center (1โ€“5)
timeoutnumber10Timeout in seconds
concurrencynumber30Parallel checks
iterationsnumber1Check rounds
onProgressfunctionโ€”(proxy, res, i, total) => void

HTTP API

POST /check โ€” accepts any mix of proxy links and list URLs

# Single proxy link
curl -u admin:secret https://your-server/check \
  -H "Content-Type: application/json" \
  -d '{"url": "tg://proxy?server=1.2.3.4&port=443&secret=ee..."}'

# Multiple sources
curl -u admin:secret https://your-server/check \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://example.com/list.txt", "tg://proxy?..."], "iterations": 2}'

Request Body

FieldTypeDefaultDescription
url / urls / uri / urisstring | string[]โ€”Proxy link(s), list URL(s), or mix
iterationsint1Check rounds
concurrencyint30Parallel checks

Response

{
  "uris": ["https://example.com/proxies.txt"],
  "iterations": 2,
  "concurrency": 20,
  "count": 150,
  "working": 42,
  "results": [
    {
      "proxy": { "server": "1.2.3.4", "port": 443, "sni": "example.com" },
      "ok": true,
      "ms": 312,
      "error": null
    }
  ]
}

In production

Real-world example โ€” proxy panel powered by mtproto-checker

core-panel.fvds.ru/app/proxies
Proxy panel
36 stable connections · auto-updated
Live
135.181.64.41
5394 ms
mt.corph.ru
8206 ms
3.telbet.lol
8208 ms
Click to visit →

Docker Deployment

SSL-terminated reverse proxy with automated CI/CD

Server structure

/etc/mtproto-checker/          # source code (auto-pulled)
โ”œโ”€โ”€ check.js
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ ...

/opt/mtproto-checker/          # configs & certs (manual)
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ default.conf
โ”œโ”€โ”€ fullchain.pem
โ””โ”€โ”€ privkey.key

docker-compose.yml

services:
  app:
    container_name: mtproto-checker
    build: /etc/mtproto-checker
    restart: unless-stopped
    environment:
      - TG_API_ID=your_api_id
      - TG_API_HASH=your_api_hash
      - CHECK_AUTH_USER=admin
      - CHECK_AUTH_PASSWORD=your_password
      - PORT=8080
    expose:
      - "8080"

  nginx:
    container_name: mtproto-checker-nginx
    image: nginx:alpine
    restart: unless-stopped
    ports:
      - "443:443"
      - "80:80"
    volumes:
      - ./default.conf:/etc/nginx/conf.d/default.conf:ro
      - ./privkey.key:/etc/nginx/ssl/privkey.key:ro
      - ./fullchain.pem:/etc/nginx/ssl/fullchain.pem:ro
    depends_on:
      - app

default.conf (nginx)

server {
    listen 443 ssl;
    server_name _;

    ssl_certificate     /etc/nginx/ssl/fullchain.pem;
    ssl_certificate_key /etc/nginx/ssl/privkey.key;
    ssl_protocols TLSv1.2 TLSv1.3;

    location / {
        proxy_pass http://app:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_read_timeout 600s;
    }
}

server {
    listen 80;
    server_name _;
    return 301 https://$host$request_uri;
}

SSL certificate (Let's Encrypt)

# Install acme.sh
sudo apt-get install cron socat
curl https://get.acme.sh | sh -s email=your@email.com && source ~/.bashrc
acme.sh --set-default-ca --server letsencrypt

# Issue certificate
acme.sh --issue --standalone -d 'your-domain.example.com' \
  --key-file /opt/mtproto-checker/privkey.key \
  --fullchain-file /opt/mtproto-checker/fullchain.pem

# Auto-renewal via cron โ€” verify:
crontab -l | grep acme

SSH key for CI/CD

Generate a deploy key on the server, then add the private key as a GitHub Secret.

# On the server
ssh-keygen -t ed25519 -C "github-actions" -f ~/.ssh/github-actions -N ""
cat ~/.ssh/github-actions.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/github-actions   # copy this โ†’ SSH_PRIVATE_KEY secret
GitHub SecretValue
SERVER_HOSTServer IP or domain
SERVER_USERSSH username (e.g. root)
SSH_PRIVATE_KEYContent of ~/.ssh/github-actions

Deploy

Trigger manually: GitHub → Actions → Deploy → "Run workflow"

# Or deploy manually on the server:
cd /opt/mtproto-checker
docker compose build --no-cache
docker compose up -d