Rust-first MTProto proxy implementation with an optional legacy-compatible wrapper binary.
mtproxy-bin: main runtime binary (mtproxy-rust)mtproxy-core: runtime logic and networking internalsmtproxy-ffi: FFI layer used by compatibility/bridge code
- Rust toolchain (
cargo,rustc) justcommand runner- build tools (
clang,ar, libc headers) for legacy wrapper builds
Example (Debian/Ubuntu):
sudo apt update
sudo apt install -y rustc cargo just clang build-essentialDebug Rust runtime:
just buildOutput: objs/bin/mtproxy-rust
Release Rust runtime:
just releaseOutput: objs/bin/mtproxy-rust
Direct Cargo release build:
cargo build --release -p mtproxy-bin --bin mtproxy-rustOutput: target/release/mtproxy-rust
Legacy-compatible wrapper (links Rust FFI into mtproto-proxy):
just build-legacy # debug
just release-legacy # releaseOutput: objs/bin/mtproto-proxy
Clean artifacts:
just cleanFetch Telegram files:
curl -fsSL https://core.telegram.org/getProxySecret -o proxy-secret
curl -fsSL https://core.telegram.org/getProxyConfig -o proxy-multi.confGenerate a proxy secret (32 hex chars):
head -c 16 /dev/urandom | xxd -psStart proxy:
./objs/bin/mtproxy-rust \
-u nobody \
-p 8888 \
-H 443 \
-S <your_32_hex_secret> \
--aes-pwd proxy-secret \
-M 1 \
proxy-multi.confShow all options:
./objs/bin/mtproxy-rust --helpClient link format:
tg://proxy?server=SERVER_NAME&port=PORT&secret=SECRET
If using @MTProxybot, pass the returned tag with -P <proxy-tag>.
Format:
just formatChecks:
just check
just clippy
just testOr run directly:
cargo check --workspace
cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspacePrefix a secret with dd to enable random padding:
cafe...babe -> ddcafe...babe