[PR #20] Add external VLESS user routing control #22

Open
opened 2026-10-13 21:10:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-xray-core/pull/20
Author: @FrogRocky
Created: 7/29/2026
Status: 🔄 Open

Base: master ← Head: frog/external-user-routing


📝 Commits (1)

  • d9419b6 Add external VLESS user routing control

📊 Changes

25 files changed (+4536 additions, -326 deletions)

View changed files

📝 app/commander/commander.go (+23 -5)
➕ app/commander/commander_test.go (+17 -0)
📝 app/commander/config.pb.go (+24 -5)
📝 app/commander/config.proto (+4 -0)
📝 app/router/balancing.go (+18 -3)
📝 app/router/balancing_override.go (+7 -1)
📝 app/router/command/command.go (+88 -0)
📝 app/router/command/command.pb.go (+313 -34)
📝 app/router/command/command.proto (+27 -0)
📝 app/router/command/command_grpc.pb.go (+76 -0)
📝 app/router/command/command_test.go (+162 -0)
📝 app/router/router.go (+524 -152)
➕ app/router/ruleset_test.go (+613 -0)
➕ examples/external-routing/README.md (+189 -0)
➕ examples/external-routing/client.json (+44 -0)
➕ examples/external-routing/server.json (+98 -0)
📝 infra/conf/api.go (+13 -6)
➕ infra/conf/api_test.go (+35 -0)
📝 proxy/vless/inbound/inbound.go (+8 -120)
➕ proxy/vless/inbound/notifications.go (+665 -0)

...and 5 more files

📄 Description

What

  • Report unknown VLESS UUIDs to a local auth service over a Unix socket.
  • Let the service add authenticated users through the existing Handler API.
  • Replace the complete ordered routing ruleset atomically.
  • Route connections by authenticated user and destination.

This lets the backend add users and update routing without restarting Xray or exposing an intermediate rule order.

Scope

This PR does not include per-user fwmark, strict socket binding, transport changes, or Docker rehearsal files. The Linux VLESS -> Freedom fwmark support is split into a separate change.

Tests

Unit and scenario tests cover unknown-user notifications, atomic rule replacement, API round trips, and authenticated VLESS user routing.


🔄 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/amnezia-vpn/amnezia-xray-core/pull/20 **Author:** [@FrogRocky](https://github.com/FrogRocky) **Created:** 7/29/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `frog/external-user-routing` --- ### 📝 Commits (1) - [`d9419b6`](https://github.com/amnezia-vpn/amnezia-xray-core/commit/d9419b64ea686e278765c358344073a75f095c4f) Add external VLESS user routing control ### 📊 Changes **25 files changed** (+4536 additions, -326 deletions) <details> <summary>View changed files</summary> 📝 `app/commander/commander.go` (+23 -5) ➕ `app/commander/commander_test.go` (+17 -0) 📝 `app/commander/config.pb.go` (+24 -5) 📝 `app/commander/config.proto` (+4 -0) 📝 `app/router/balancing.go` (+18 -3) 📝 `app/router/balancing_override.go` (+7 -1) 📝 `app/router/command/command.go` (+88 -0) 📝 `app/router/command/command.pb.go` (+313 -34) 📝 `app/router/command/command.proto` (+27 -0) 📝 `app/router/command/command_grpc.pb.go` (+76 -0) 📝 `app/router/command/command_test.go` (+162 -0) 📝 `app/router/router.go` (+524 -152) ➕ `app/router/ruleset_test.go` (+613 -0) ➕ `examples/external-routing/README.md` (+189 -0) ➕ `examples/external-routing/client.json` (+44 -0) ➕ `examples/external-routing/server.json` (+98 -0) 📝 `infra/conf/api.go` (+13 -6) ➕ `infra/conf/api_test.go` (+35 -0) 📝 `proxy/vless/inbound/inbound.go` (+8 -120) ➕ `proxy/vless/inbound/notifications.go` (+665 -0) _...and 5 more files_ </details> ### 📄 Description ## What - Report unknown VLESS UUIDs to a local auth service over a Unix socket. - Let the service add authenticated users through the existing Handler API. - Replace the complete ordered routing ruleset atomically. - Route connections by authenticated user and destination. This lets the backend add users and update routing without restarting Xray or exposing an intermediate rule order. ## Scope This PR does **not** include per-user `fwmark`, strict socket binding, transport changes, or Docker rehearsal files. The Linux `VLESS -> Freedom` fwmark support is split into a separate change. ## Tests Unit and scenario tests cover unknown-user notifications, atomic rule replacement, API round trips, and authenticated VLESS user routing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
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
amnezia-vpn/amnezia-xray-core#22
No description provided.