[PR #3745] [CLOSED] Add Connection Reporting for Restricted Networks #5519

Closed
opened 2026-10-31 20:47:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/3745
Author: @shatinz
Created: 2/4/2026
Status: ❌ Closed

Base: main ← Head: feature/connection-reporting-v2


📝 Commits (1)

  • 3a57ebf # Pull Request: Connection Reporting System & Improvements for Restricted Networks

📊 Changes

49 files changed (+891 additions, -1846 deletions)

View changed files

➖ .github/copilot-instructions.md (+0 -155)
➖ .github/workflows/cleanup_caches.yml (+0 -31)
📝 .github/workflows/release.yml (+9 -30)
📝 DockerInit.sh (+1 -1)
📝 config/version (+1 -1)
📝 database/db.go (+1 -0)
➕ database/model/report.go (+15 -0)
📝 go.mod (+15 -11)
📝 go.sum (+33 -22)
📝 install.sh (+3 -3)
📝 sub/sub.go (+1 -27)
📝 sub/subController.go (+16 -46)
📝 sub/subService.go (+26 -1)
📝 update.sh (+3 -3)
📝 web/assets/js/model/inbound.js (+36 -140)
📝 web/assets/js/model/outbound.js (+43 -105)
📝 web/assets/js/model/reality_targets.js (+14 -10)
📝 web/assets/js/model/setting.js (+0 -5)
➕ web/controller/report.go (+78 -0)
📝 web/entity/entity.go (+0 -5)

...and 29 more files

📄 Description

Pull Request: Connection Reporting System & Improvements for Restricted Networks

Description

This PR introduces a comprehensive Connection Reporting System designed to improve the reliability and monitoring of connections, specifically tailored for environments with restricted internet access (e.g., active censorship, GFW).

Key Changes

  1. New Reporting API (/report):

    • Added ReportController and ReportService to handle incoming connection reports.
    • Endpoint receives data such as Latency, Success status, Protocol, and Client Interface details.
    • Data is persisted to the database via the new ConnectionReport model.
  2. Subscription Link Updates:

    • Modified subService to append a reportUrl parameter to generated subscription links (VLESS, VMess, etc.).
    • This allows compatible clients to automatically discover the reporting endpoint and send feedback.
  3. Database Integration:

    • Added ConnectionReport schema to database/model and registered it in database/db.go for auto-migration.

Why is this helpful for Restricted Internet Locations?

In regions with heavy internet censorship, connection stability is volatile.

  • Dynamic Reporting Endpoint: The reportUrl parameter embedded in the subscription link explicitly tells the client where to send connection data.
  • Bypassing Blocking: By decoupling the reporting URL from the node address, clients can ensure diagnostic data reaches the panel even if specific node IPs are being interfered with (assuming the panel itself is reachable).
  • Real-time Network Intelligence: This mechanism enables the panel to aggregate "ground truth" data from clients inside the restricted network (e.g., latency, accessibility of specific protocols), allowing admins to react faster to blocking events.
  • Protocol Performance Tracking: Allows comparison of different protocols (Reality vs. VLESS+TLS vs. Trojan) based on real-world latency and success rates from actual users.
  • Rapid Troubleshooting: Administrators can see connection quality trends and rotate IPs/domains proactively when success rates drop, minimizing downtime for users.

Technical Details

  • API Endpoint: POST /report
  • Payload Format: JSON containing SystemInfo (Interface), ConnectionQuality (Latency, Success), and ProtocolInfo.
  • Security: Reports are tied to valid client request contexts (implementation detail: ensure endpoint is rate-limited or authenticated if necessary, though currently designed for open reporting from valid sub links).

How to Test

  1. Update the panel.
  2. Generate a subscription link.
  3. Observe the reportUrl parameter in the link.
  4. Simulate a client POST to the report URL and verify the entry in the ConnectionReports table.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/3745 **Author:** [@shatinz](https://github.com/shatinz) **Created:** 2/4/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/connection-reporting-v2` --- ### 📝 Commits (1) - [`3a57ebf`](https://github.com/MHSanaei/3x-ui/commit/3a57ebffe79c3e99f9296eab005ac3ca0d51aa56) # Pull Request: Connection Reporting System & Improvements for Restricted Networks ### 📊 Changes **49 files changed** (+891 additions, -1846 deletions) <details> <summary>View changed files</summary> ➖ `.github/copilot-instructions.md` (+0 -155) ➖ `.github/workflows/cleanup_caches.yml` (+0 -31) 📝 `.github/workflows/release.yml` (+9 -30) 📝 `DockerInit.sh` (+1 -1) 📝 `config/version` (+1 -1) 📝 `database/db.go` (+1 -0) ➕ `database/model/report.go` (+15 -0) 📝 `go.mod` (+15 -11) 📝 `go.sum` (+33 -22) 📝 `install.sh` (+3 -3) 📝 `sub/sub.go` (+1 -27) 📝 `sub/subController.go` (+16 -46) 📝 `sub/subService.go` (+26 -1) 📝 `update.sh` (+3 -3) 📝 `web/assets/js/model/inbound.js` (+36 -140) 📝 `web/assets/js/model/outbound.js` (+43 -105) 📝 `web/assets/js/model/reality_targets.js` (+14 -10) 📝 `web/assets/js/model/setting.js` (+0 -5) ➕ `web/controller/report.go` (+78 -0) 📝 `web/entity/entity.go` (+0 -5) _...and 29 more files_ </details> ### 📄 Description # Pull Request: Connection Reporting System & Improvements for Restricted Networks ## Description This PR introduces a comprehensive **Connection Reporting System** designed to improve the reliability and monitoring of connections, specifically tailored for environments with restricted internet access (e.g., active censorship, GFW). ### Key Changes 1. **New Reporting API (`/report`)**: * Added `ReportController` and `ReportService` to handle incoming connection reports. * Endpoint receives data such as `Latency`, `Success` status, `Protocol`, and Client Interface details. * Data is persisted to the database via the new `ConnectionReport` model. 2. **Subscription Link Updates**: * Modified `subService` to append a `reportUrl` parameter to generated subscription links (VLESS, VMess, etc.). * This allows compatible clients to automatically discover the reporting endpoint and send feedback. 3. **Database Integration**: * Added `ConnectionReport` schema to `database/model` and registered it in `database/db.go` for auto-migration. ## Why is this helpful for Restricted Internet Locations? In regions with heavy internet censorship, connection stability is volatile. * **Dynamic Reporting Endpoint**: The `reportUrl` parameter embedded in the subscription link explicitly tells the client *where* to send connection data. * **Bypassing Blocking**: By decoupling the reporting URL from the node address, clients can ensure diagnostic data reaches the panel even if specific node IPs are being interfered with (assuming the panel itself is reachable). * **Real-time Network Intelligence**: This mechanism enables the panel to aggregate "ground truth" data from clients inside the restricted network (e.g., latency, accessibility of specific protocols), allowing admins to react faster to blocking events. * **Protocol Performance Tracking**: Allows comparison of different protocols (Reality vs. VLESS+TLS vs. Trojan) based on real-world latency and success rates from actual users. * **Rapid Troubleshooting**: Administrators can see connection quality trends and rotate IPs/domains proactively when success rates drop, minimizing downtime for users. ## Technical Details * **API Endpoint**: `POST /report` * **Payload Format**: JSON containing `SystemInfo` (Interface), `ConnectionQuality` (Latency, Success), and `ProtocolInfo`. * **Security**: Reports are tied to valid client request contexts (implementation detail: ensure endpoint is rate-limited or authenticated if necessary, though currently designed for open reporting from valid sub links). ## How to Test 1. Update the panel. 2. Generate a subscription link. 3. Observe the `reportUrl` parameter in the link. 4. Simulate a client POST to the report URL and verify the entry in the `ConnectionReports` table. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:47:32 +07:00
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#5519
No description provided.