mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
API - Add | Remove Routing Rules (#3189)
* add RuleTag to routing rules * add router pb commands * add and remove routing rules api * cleanup * fix * improve error msg * add append flag apply balancer config
This commit is contained in:
parent
8a439bf3f2
commit
53e5814d19
13 changed files with 901 additions and 269 deletions
|
@ -7,6 +7,7 @@ option java_package = "com.xray.app.router.command";
|
|||
option java_multiple_files = true;
|
||||
|
||||
import "common/net/network.proto";
|
||||
import "common/serial/typed_message.proto";
|
||||
|
||||
// RoutingContext is the context with information relative to routing process.
|
||||
// It conforms to the structure of xray.features.routing.Context and
|
||||
|
@ -88,6 +89,18 @@ message OverrideBalancerTargetRequest {
|
|||
|
||||
message OverrideBalancerTargetResponse {}
|
||||
|
||||
message AddRuleRequest {
|
||||
xray.common.serial.TypedMessage config = 1;
|
||||
bool shouldAppend = 2;
|
||||
}
|
||||
message AddRuleResponse {}
|
||||
|
||||
message RemoveRuleRequest {
|
||||
string ruleTag = 1;
|
||||
}
|
||||
|
||||
message RemoveRuleResponse {}
|
||||
|
||||
service RoutingService {
|
||||
rpc SubscribeRoutingStats(SubscribeRoutingStatsRequest)
|
||||
returns (stream RoutingContext) {}
|
||||
|
@ -95,6 +108,9 @@ service RoutingService {
|
|||
|
||||
rpc GetBalancerInfo(GetBalancerInfoRequest) returns (GetBalancerInfoResponse){}
|
||||
rpc OverrideBalancerTarget(OverrideBalancerTargetRequest) returns (OverrideBalancerTargetResponse) {}
|
||||
|
||||
rpc AddRule(AddRuleRequest) returns (AddRuleResponse) {}
|
||||
rpc RemoveRule(RemoveRuleRequest) returns (RemoveRuleResponse) {}
|
||||
}
|
||||
|
||||
message Config {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue