explaingit

liafanx/mtproxy-reanimation

Analysis updated 2026-05-18

49ShellAudience · ops devopsComplexity · 3/5Setup · moderate

TLDR

A shell script that adds per-client connection rate limiting to Telegram proxy servers (Telemt or MTProxyMax) to stop connection floods from crashing the service.

Mindmap

mindmap
  root((MTproxy Reanimation))
    Problem
      Connection Floods
      Proxy Instability
    Mechanism
      nftables Rules
      Per-IP Counters
      Auto Detect Deployment
    Tooling
      mtpr Menu
      Preset Strictness Levels
      systemd Service
    Safety
      Config Backups
      Add-on Not Replacement

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Stop one misbehaving client from overwhelming a Telemt or MTProxyMax proxy server with connection floods.

USE CASE 2

Apply per-client nftables rate limits automatically across host, Docker, or MTProxyMax deployments.

USE CASE 3

Tune Telemt timeout parameters like handshake wait time for slow mobile networks.

USE CASE 4

Switch between strict, medium, and relaxed limiter presets using the mtpr menu tool.

What is it built with?

Shellnftablessystemd

How does it compare?

liafanx/mtproxy-reanimationpeppy/dotfileszealchou/fable5-scaffold
Stars494847
LanguageShellShellShell
Last pushed2026-07-01
MaintenanceActive
Setup difficultymoderatemoderatemoderate
Complexity3/52/53/5
Audienceops devopsdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires root access and a systemd-based Linux system, meant as an add-on to an existing Telemt install.

In plain English

MTproxy-reanimation is a shell script utility for Linux servers that run Telemt or MTProxyMax, which are Telegram proxy servers. The tool solves a specific stability problem: when many clients try to connect at the same moment, the proxy can choke on the flood of incoming TCP connection requests. This script adds a per-client rate limit on those initial connection packets so that one misbehaving client cannot knock over service for everyone else. The limiting works at the kernel network level using nftables, a Linux firewall system built into the kernel. Each connecting IP address gets its own independent counter, so a noisy client gets throttled without affecting other users. The script automatically figures out whether Telemt is running directly on the host, inside a Docker container, or via the MTProxyMax variant, and applies the correct nftables hook accordingly. Beyond the connection limiter, the script also applies a set of Telemt timing parameters: how long to wait for the upstream Telegram connection, how long to wait for the initial client handshake, and how long an idle client can sit before being dropped. These timeouts have sensible defaults and the README explains when to raise them, for example on mobile networks where connections are slow to establish. Installation is a single curl command that downloads and runs the installer. After that, a menu tool called mtpr gives access to all options: applying or removing the nftables rules, switching between three preset strictness levels (strict, medium, and relaxed), viewing a live drop counter, and managing the systemd service that keeps the limiter running across reboots. Before modifying any config file, the script automatically saves a timestamped backup. The script is intended as an add-on to existing Telemt installations, not a replacement. It does not touch the Telemt Panel configuration and removes only its own files when uninstalled. It requires root access and a Linux system with systemd, nftables is installed automatically if missing.

Copy-paste prompts

Prompt 1
Explain how per-client nftables rate limiting stops a connection flood from taking down a Telegram proxy server.
Prompt 2
Walk me through installing this rate limiter on my Telemt server with the curl installer and the mtpr menu.
Prompt 3
Help me choose between the strict, medium, and relaxed presets for my proxy's traffic pattern.
Prompt 4
How do I adjust Telemt's handshake and idle timeout values for clients on slow mobile networks?
Prompt 5
Show me how to check the live connection drop counter and confirm the limiter is working.

Frequently asked questions

What is mtproxy-reanimation?

A shell script that adds per-client connection rate limiting to Telegram proxy servers (Telemt or MTProxyMax) to stop connection floods from crashing the service.

What language is mtproxy-reanimation written in?

Mainly Shell. The stack also includes Shell, nftables, systemd.

How hard is mtproxy-reanimation to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is mtproxy-reanimation for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.