github.com/imannamdari/v2ray-core/v5@v5.0.5/app/router/config.proto (about) 1 syntax = "proto3"; 2 3 package v2ray.core.app.router; 4 option csharp_namespace = "V2Ray.Core.App.Router"; 5 option go_package = "github.com/imannamdari/v2ray-core/v5/app/router"; 6 option java_package = "com.v2ray.core.app.router"; 7 option java_multiple_files = true; 8 9 import "google/protobuf/any.proto"; 10 import "common/net/port.proto"; 11 import "common/net/network.proto"; 12 import "common/protoext/extensions.proto"; 13 import "app/router/routercommon/common.proto"; 14 15 16 message RoutingRule { 17 oneof target_tag { 18 // Tag of outbound that this rule is pointing to. 19 string tag = 1; 20 21 // Tag of routing balancer. 22 string balancing_tag = 12; 23 } 24 25 // List of domains for target domain matching. 26 repeated v2ray.core.app.router.routercommon.Domain domain = 2; 27 28 // List of CIDRs for target IP address matching. 29 // Deprecated. Use geoip below. 30 repeated v2ray.core.app.router.routercommon.CIDR cidr = 3 [deprecated = true]; 31 32 // List of GeoIPs for target IP address matching. If this entry exists, the 33 // cidr above will have no effect. GeoIP fields with the same country code are 34 // supposed to contain exactly same content. They will be merged during 35 // runtime. For customized GeoIPs, please leave country code empty. 36 repeated v2ray.core.app.router.routercommon.GeoIP geoip = 10; 37 38 // A range of port [from, to]. If the destination port is in this range, this 39 // rule takes effect. Deprecated. Use port_list. 40 v2ray.core.common.net.PortRange port_range = 4 [deprecated = true]; 41 42 // List of ports. 43 v2ray.core.common.net.PortList port_list = 14; 44 45 // List of networks. Deprecated. Use networks. 46 v2ray.core.common.net.NetworkList network_list = 5 [deprecated = true]; 47 48 // List of networks for matching. 49 repeated v2ray.core.common.net.Network networks = 13; 50 51 // List of CIDRs for source IP address matching. 52 repeated v2ray.core.app.router.routercommon.CIDR source_cidr = 6 [deprecated = true]; 53 54 // List of GeoIPs for source IP address matching. If this entry exists, the 55 // source_cidr above will have no effect. 56 repeated v2ray.core.app.router.routercommon.GeoIP source_geoip = 11; 57 58 // List of ports for source port matching. 59 v2ray.core.common.net.PortList source_port_list = 16; 60 61 repeated string user_email = 7; 62 repeated string inbound_tag = 8; 63 repeated string protocol = 9; 64 65 string attributes = 15; 66 67 string domain_matcher = 17; 68 69 // geo_domain instruct simplified config loader to load geo domain rule and fill in domain field. 70 repeated v2ray.core.app.router.routercommon.GeoSite geo_domain = 68001; 71 } 72 73 message BalancingRule { 74 string tag = 1; 75 repeated string outbound_selector = 2; 76 string strategy = 3; 77 google.protobuf.Any strategy_settings = 4; 78 string fallback_tag = 5; 79 } 80 81 message StrategyWeight { 82 bool regexp = 1; 83 string match = 2; 84 float value = 3; 85 } 86 87 message StrategyRandomConfig { 88 option (v2ray.core.common.protoext.message_opt).type = "balancer"; 89 option (v2ray.core.common.protoext.message_opt).short_name = "random"; 90 } 91 92 message StrategyLeastPingConfig { 93 option (v2ray.core.common.protoext.message_opt).type = "balancer"; 94 option (v2ray.core.common.protoext.message_opt).short_name = "leastping"; 95 96 string observer_tag = 7; 97 } 98 99 message StrategyLeastLoadConfig { 100 option (v2ray.core.common.protoext.message_opt).type = "balancer"; 101 option (v2ray.core.common.protoext.message_opt).short_name = "leastload"; 102 103 // weight settings 104 repeated StrategyWeight costs = 2; 105 // RTT baselines for selecting, int64 values of time.Duration 106 repeated int64 baselines = 3; 107 // expected nodes count to select 108 int32 expected = 4; 109 // max acceptable rtt, filter away high delay nodes. defalut 0 110 int64 maxRTT = 5; 111 // acceptable failure rate 112 float tolerance = 6; 113 114 string observer_tag = 7; 115 } 116 117 enum DomainStrategy { 118 // Use domain as is. 119 AsIs = 0; 120 121 // Always resolve IP for domains. 122 UseIp = 1; 123 124 // Resolve to IP if the domain doesn't match any rules. 125 IpIfNonMatch = 2; 126 127 // Resolve to IP if any rule requires IP matching. 128 IpOnDemand = 3; 129 } 130 131 message Config { 132 DomainStrategy domain_strategy = 1; 133 repeated RoutingRule rule = 2; 134 repeated BalancingRule balancing_rule = 3; 135 } 136 137 message SimplifiedRoutingRule { 138 oneof target_tag { 139 // Tag of outbound that this rule is pointing to. 140 string tag = 1; 141 142 // Tag of routing balancer. 143 string balancing_tag = 12; 144 } 145 146 // List of domains for target domain matching. 147 repeated v2ray.core.app.router.routercommon.Domain domain = 2; 148 149 // List of GeoIPs for target IP address matching. If this entry exists, the 150 // cidr above will have no effect. GeoIP fields with the same country code are 151 // supposed to contain exactly same content. They will be merged during 152 // runtime. For customized GeoIPs, please leave country code empty. 153 repeated v2ray.core.app.router.routercommon.GeoIP geoip = 10; 154 155 // List of ports. 156 string port_list = 14; 157 158 // List of networks for matching. 159 v2ray.core.common.net.NetworkList networks = 13; 160 161 // List of GeoIPs for source IP address matching. If this entry exists, the 162 // source_cidr above will have no effect. 163 repeated v2ray.core.app.router.routercommon.GeoIP source_geoip = 11; 164 165 // List of ports for source port matching. 166 string source_port_list = 16; 167 168 repeated string user_email = 7; 169 repeated string inbound_tag = 8; 170 repeated string protocol = 9; 171 172 string attributes = 15; 173 174 string domain_matcher = 17; 175 176 // geo_domain instruct simplified config loader to load geo domain rule and fill in domain field. 177 repeated v2ray.core.app.router.routercommon.GeoSite geo_domain = 68001; 178 } 179 180 message SimplifiedConfig { 181 option (v2ray.core.common.protoext.message_opt).type = "service"; 182 option (v2ray.core.common.protoext.message_opt).short_name = "router"; 183 184 DomainStrategy domain_strategy = 1; 185 repeated SimplifiedRoutingRule rule = 2; 186 repeated BalancingRule balancing_rule = 3; 187 }