github.com/xmplusdev/xray-core@v1.8.10/app/router/command/command.proto (about) 1 syntax = "proto3"; 2 3 package xray.app.router.command; 4 option csharp_namespace = "Xray.App.Router.Command"; 5 option go_package = "github.com/xmplusdev/xray-core/app/router/command"; 6 option java_package = "com.xray.app.router.command"; 7 option java_multiple_files = true; 8 9 import "common/net/network.proto"; 10 import "common/serial/typed_message.proto"; 11 12 // RoutingContext is the context with information relative to routing process. 13 // It conforms to the structure of xray.features.routing.Context and 14 // xray.features.routing.Route. 15 message RoutingContext { 16 string InboundTag = 1; 17 xray.common.net.Network Network = 2; 18 repeated bytes SourceIPs = 3; 19 repeated bytes TargetIPs = 4; 20 uint32 SourcePort = 5; 21 uint32 TargetPort = 6; 22 string TargetDomain = 7; 23 string Protocol = 8; 24 string User = 9; 25 map<string, string> Attributes = 10; 26 repeated string OutboundGroupTags = 11; 27 string OutboundTag = 12; 28 } 29 30 // SubscribeRoutingStatsRequest subscribes to routing statistics channel if 31 // opened by xray-core. 32 // * FieldSelectors selects a subset of fields in routing statistics to return. 33 // Valid selectors: 34 // - inbound: Selects connection's inbound tag. 35 // - network: Selects connection's network. 36 // - ip: Equivalent as "ip_source" and "ip_target", selects both source and 37 // target IP. 38 // - port: Equivalent as "port_source" and "port_target", selects both source 39 // and target port. 40 // - domain: Selects target domain. 41 // - protocol: Select connection's protocol. 42 // - user: Select connection's inbound user email. 43 // - attributes: Select connection's additional attributes. 44 // - outbound: Equivalent as "outbound" and "outbound_group", select both 45 // outbound tag and outbound group tags. 46 // * If FieldSelectors is left empty, all fields will be returned. 47 message SubscribeRoutingStatsRequest { 48 repeated string FieldSelectors = 1; 49 } 50 51 // TestRouteRequest manually tests a routing result according to the routing 52 // context message. 53 // * RoutingContext is the routing message without outbound information. 54 // * FieldSelectors selects the fields to return in the routing result. All 55 // fields are returned if left empty. 56 // * PublishResult broadcasts the routing result to routing statistics channel 57 // if set true. 58 message TestRouteRequest { 59 RoutingContext RoutingContext = 1; 60 repeated string FieldSelectors = 2; 61 bool PublishResult = 3; 62 } 63 64 message PrincipleTargetInfo { 65 repeated string tag = 1; 66 } 67 68 message OverrideInfo { 69 string target = 2; 70 } 71 72 message BalancerMsg { 73 OverrideInfo override = 5; 74 PrincipleTargetInfo principle_target = 6; 75 } 76 77 message GetBalancerInfoRequest { 78 string tag = 1; 79 } 80 81 message GetBalancerInfoResponse { 82 BalancerMsg balancer = 1; 83 } 84 85 message OverrideBalancerTargetRequest { 86 string balancerTag = 1; 87 string target = 2; 88 } 89 90 message OverrideBalancerTargetResponse {} 91 92 message AddRuleRequest { 93 xray.common.serial.TypedMessage config = 1; 94 bool shouldAppend = 2; 95 } 96 message AddRuleResponse {} 97 98 message RemoveRuleRequest { 99 string ruleTag = 1; 100 } 101 102 message RemoveRuleResponse {} 103 104 service RoutingService { 105 rpc SubscribeRoutingStats(SubscribeRoutingStatsRequest) 106 returns (stream RoutingContext) {} 107 rpc TestRoute(TestRouteRequest) returns (RoutingContext) {} 108 109 rpc GetBalancerInfo(GetBalancerInfoRequest) returns (GetBalancerInfoResponse){} 110 rpc OverrideBalancerTarget(OverrideBalancerTargetRequest) returns (OverrideBalancerTargetResponse) {} 111 112 rpc AddRule(AddRuleRequest) returns (AddRuleResponse) {} 113 rpc RemoveRule(RemoveRuleRequest) returns (RemoveRuleResponse) {} 114 } 115 116 message Config {}