ferogram-connect
Raw TCP connection, MTProto framing, and transport layer for ferogram.
Sits between a raw TcpStream and decrypted MTProto messages. The ferogram crate uses this internally; most people never need to depend on it directly. If you're just building a bot or a client, start with ferogram instead.
ferogram re-exports everything here, so existing code needs no changes.
What it does
Takes a TCP connection to a Telegram DC and gives back decrypted, framed MTProto messages.
- Abridged, Intermediate, Padded Intermediate, and Full transport framing
- Obfuscated2 AES-256-CTR transport for bypassing DPI and MTProxy
- FakeTLS transport for
0xeeMTProxy secrets - SOCKS5 proxy with optional username/password (feature:
socks5) - MTProxy (
tg://proxy?...andhttps://t.me/proxy?...) parsing and connection - Keepalive pings with configurable interval
- gzip inflate and compress for MTProto containers
- MTProto envelope unwrapping and entity extraction
Transports
use TransportKind;
// Plain abridged (default)
Abridged
// Obfuscated2: bypasses ISP blocks, works with plain MTProxy secrets
Obfuscated
// Padded Intermediate: required for 0xdd MTProxy secrets
PaddedIntermediate
// FakeTLS: required for 0xee MTProxy secrets
FakeTls
MTProxy
use MtProxyConfig;
// Parse a proxy link directly
let proxy = parse_proxy_link?;
// Or build manually
let proxy = MtProxyConfig ;
SOCKS5 (feature: socks5)
Pulls in tokio-socks; off by default since it's not needed for direct connections to Telegram datacenters.
use Socks5Config;
let socks = new;
let socks_auth = with_auth;
Feature flags
| Flag | What it enables |
|---|---|
socks5 |
Socks5Config and SOCKS5 proxy support for outgoing connections |
Stack position
ferogram
└ ferogram-mtsender
└ ferogram-connect <-- here
├ ferogram-mtproto
└ ferogram-crypto
License
This project is licensed under either the MIT License or Apache License 2.0, at your option. See LICENSE-MIT and LICENSE-APACHE for details.
Author: Ankit Chaubey (@ankit-chaubey)