[GH-ISSUE #5207] [Feature]: #3651

Closed
opened 2026-10-31 20:33:58 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @masir-sefid on GitHub (Jun 11, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5207

Hello, thanks for your great work!
I would like to suggest adding an IP limit per client (restricting the number of concurrent connections for each client).
​Additionally, it would be great to add real-time statistics to the panel, accessible via a command.

Describe the solution you'd like

ss -ntu state established | awk '{print $5}' | sed -E 's/:[0-9]+$//' | sort | uniq | wc -l

Alternatives you've considered

No response

Concrete use case

No response

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

No response

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @masir-sefid on GitHub (Jun 11, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5207 ### Is your feature request related to a problem? Hello, thanks for your great work! I would like to suggest adding an IP limit per client (restricting the number of concurrent connections for each client). ​Additionally, it would be great to add real-time statistics to the panel, accessible via a command. ### Describe the solution you'd like ss -ntu state established | awk '{print $5}' | sed -E 's/:[0-9]+$//' | sort | uniq | wc -l ### Alternatives you've considered _No response_ ### Concrete use case _No response_ ### Mockups, screenshots, or examples _No response_ ### Which parts of the panel would this affect? _No response_ ### Are you willing to help? - [ ] I'd like to implement this feature myself and open a PR. - [ ] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
bsakaguchi 2026-10-31 20:33:58 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 11, 2026):

Both features described here already exist in the panel.

IP limit per client (concurrent connections)

The LimitIP field is already implemented — see internal/database/model/model.go (line 564) and enforced by internal/web/job/check_client_ip_job.go. It requires two setup steps:

  1. Enable the Xray access log:

    • Panel → Xray Settings → Basics tab
    • Change Access Log from none to ./access.log, save, and restart Xray.
    • The Limit IP field then becomes visible when creating or editing any client.
  2. Install Fail2ban to actually block addresses that exceed the limit (without it, violations are only logged):

    x-ui
    

    Select IP Limit → Install Fail2ban and configure IP Limit.

The enforcement loop parses the access log, merges per-client IP history, and calls fail2ban-client to ban older IPs when a client's live connection count exceeds its configured limit. In multi-node setups the IP state is shared across nodes automatically.

Real-time connection statistics

The second request appears to be cut off mid-sentence ("accessible via" with no further text after the shell command). If the intent is to view which clients are currently connected: the panel already shows online clients using the Xray gRPC stats API — see internal/xray/process.go (GetOnlineClients). This is updated on each stats polling cycle and displayed in the Inbounds view.

If there is a distinct feature you would like that is not covered by either of the above, please open a new issue with a complete description.

This is a duplicate of #5180 (which includes the same explanation and setup steps).

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4683529089 --> @github-actions[bot] commented on GitHub (Jun 11, 2026): Both features described here already exist in the panel. **IP limit per client (concurrent connections)** The `LimitIP` field is already implemented — see `internal/database/model/model.go` (line 564) and enforced by `internal/web/job/check_client_ip_job.go`. It requires two setup steps: 1. Enable the Xray access log: - Panel → **Xray Settings → Basics** tab - Change **Access Log** from `none` to `./access.log`, save, and restart Xray. - The **Limit IP** field then becomes visible when creating or editing any client. 2. Install Fail2ban to actually block addresses that exceed the limit (without it, violations are only logged): ``` x-ui ``` Select **IP Limit → Install Fail2ban and configure IP Limit**. The enforcement loop parses the access log, merges per-client IP history, and calls `fail2ban-client` to ban older IPs when a client's live connection count exceeds its configured limit. In multi-node setups the IP state is shared across nodes automatically. **Real-time connection statistics** The second request appears to be cut off mid-sentence ("accessible via" with no further text after the shell command). If the intent is to view which clients are currently connected: the panel already shows online clients using the Xray gRPC stats API — see `internal/xray/process.go` (`GetOnlineClients`). This is updated on each stats polling cycle and displayed in the Inbounds view. If there is a distinct feature you would like that is not covered by either of the above, please open a new issue with a complete description. This is a duplicate of #5180 (which includes the same explanation and setup steps). *This reply was generated automatically; a maintainer may follow up.*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3651
No description provided.