Skip to content

Commit 3ee4949

Browse files
committed
Update docs: recommend conns over ips for device limiting, clarify lifetime quotas
1 parent 1b22492 commit 3ee4949

1 file changed

Lines changed: 27 additions & 21 deletions

File tree

README.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,16 @@ Each user gets their own **secret key** with a human-readable label:
100100

101101
Fine-grained limits enforced at the engine level:
102102

103-
| Limit | Description | Example |
104-
|-------|-------------|---------|
105-
| **Max Connections** | Simultaneous TCP connections | `100` |
106-
| **Max IPs** | Unique devices/IPs allowed | `5` |
107-
| **Data Quota** | Total bandwidth cap | `10G`, `500M` |
108-
| **Expiry Date** | Auto-disable after date | `2026-12-31` |
103+
| Limit | Description | Example | Best For |
104+
|-------|-------------|---------|----------|
105+
| **Max Connections** | Concurrent connections (1 app = 1 conn) | `3` | **Device limiting** |
106+
| **Max IPs** | Unique IP addresses allowed | `5` | Anti-sharing / abuse |
107+
| **Data Quota** | Lifetime bandwidth cap | `10G`, `500M` | Fair usage |
108+
| **Expiry Date** | Auto-disable after date | `2026-12-31` | Temporary access |
109+
110+
> **Tip: Use `conns` for device limits, not `ips`.** Each Telegram app opens exactly 1 connection (multiplexed internally), so `conns 3` = max 3 devices. IP limits are less reliable because mobile users roam between cell towers (briefly showing 2 IPs for 1 device), and multiple devices behind the same WiFi share 1 IP. Use `ips` as a secondary anti-sharing measure.
111+
>
112+
> **Traffic and quotas are lifetime (cumulative)**, not monthly. They don't auto-reset. To reset a user's traffic, rotate their secret.
109113
110114
```bash
111115
mtproxymax secret setlimits alice 100 5 10G 2026-12-31
@@ -116,27 +120,29 @@ mtproxymax secret setlimits alice 100 5 10G 2026-12-31
116120
### 📋 User Management Recipes
117121

118122
<details>
119-
<summary><b>Prevent Key Sharing</b></summary>
123+
<summary><b>Limit Devices Per User (Recommended)</b></summary>
120124

121125
```bash
122-
mtproxymax secret setlimit alice ips 1 # Single person only
123-
mtproxymax secret setlimit family ips 5 # Family of up to 5 devices
126+
mtproxymax secret setlimit alice conns 1 # Single device only
127+
mtproxymax secret setlimit family conns 5 # Family up to 5 devices
124128
```
125129

126-
If someone with `ips 1` shares their link, the second device gets rejected automatically.
130+
If someone with `conns 1` shares their link, the second device can't connect. Each Telegram app = exactly 1 connection.
127131

128132
</details>
129133

130134
<details>
131-
<summary><b>IP Limit Tiers</b></summary>
135+
<summary><b>Device Limit Tiers</b></summary>
136+
137+
| Scenario | `conns` | `ips` (optional) |
138+
|----------|---------|-------------------|
139+
| Single person, one device | `1` | `2` (allow roaming) |
140+
| Single person, multiple devices | `3` | `5` |
141+
| Small family | `5` | `10` |
142+
| Small group / office | `30` | `50` |
143+
| Public/open link | `0` | `0` (unlimited) |
132144

133-
| Scenario | `max_ips` |
134-
|----------|-----------|
135-
| Single person, one device | `1` |
136-
| Single person, multiple devices | `2-3` |
137-
| Small family | `5` |
138-
| Small group / office | `20-30` |
139-
| Public/open link | `0` (unlimited) |
145+
> Set `ips` slightly higher than `conns` to allow for mobile roaming (cell tower switches temporarily show 2 IPs for 1 device).
140146
141147
</details>
142148

@@ -161,9 +167,9 @@ mtproxymax secret add bob
161167
mtproxymax secret add charlie
162168

163169
# Each person gets their own link — revoke individually
164-
mtproxymax secret setlimit alice ips 2
165-
mtproxymax secret setlimit bob ips 1
166-
mtproxymax secret setlimit charlie ips 3
170+
mtproxymax secret setlimit alice conns 2 # 2 devices
171+
mtproxymax secret setlimit bob conns 1 # 1 device
172+
mtproxymax secret setlimit charlie conns 3 # 3 devices
167173
```
168174

169175
</details>

0 commit comments

Comments
 (0)