How alexbers/mtprotoproxy works
Async MTProto Proxy accepts Telegram client connections, applies configured MTProto modes and secrets, establishes upstream proxy connections, and relays traffic. The runtime is concentrated in one large module; the local pure-Python AES package supplies an encryption fallback. The README also documents channel-ad tags, statistics, multiple instances, and optional Prometheus export. Source excerpts show configuration handling, encryption adapters, relay accounting, and startup, but omit much of the connection-handler implementation; uncertain internal calls are therefore not asserted.
Main entry points: mtprotoproxy.py Async MTProto proxy · __init__.py AES API · blockfeeder.py Block feeder · aes.py AES modes
Components 10
Proxy runtime
- Async MTProto proxy
mtprotoproxy.py - Proxy configuration
config.py
Encryption
- AES API
pyaes/__init__.py - AES modes
pyaes/aes.py - Block feeder
pyaes/blockfeeder.py - AES utilities
pyaes/util.py
Operations
- Runtime statistics
mtprotoproxy.py
Other components
- Telegram clients
- Telegram network
- Prometheus
Connections 10
- Telegram clients → Async MTProto proxy: connects to
README.md - Proxy configuration → Async MTProto proxy: configures
README.md - Async MTProto proxy → Telegram network: relays traffic
- Async MTProto proxy → AES API: uses encryption
mtprotoproxy.py - AES API → AES modes: exports modes
pyaes/__init__.py - AES API → Block feeder: exports feeders
pyaes/__init__.py - Block feeder → AES modes: feeds cipher modes
pyaes/blockfeeder.py - Block feeder → AES utilities: uses padding
pyaes/blockfeeder.py - Async MTProto proxy → Runtime statistics: updates counters
mtprotoproxy.py - Runtime statistics → Prometheus: exports metrics
README.md