1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-30 02:55:23 +00:00
v2fly/app/router/config.proto

187 lines
5.7 KiB
Protocol Buffer
Raw Normal View History

2016-10-11 21:02:44 +00:00
syntax = "proto3";
2016-10-12 14:11:13 +00:00
package v2ray.core.app.router;
2016-12-22 23:24:28 +00:00
option csharp_namespace = "V2Ray.Core.App.Router";
option go_package = "github.com/v2fly/v2ray-core/v5/app/router";
2016-10-12 14:11:13 +00:00
option java_package = "com.v2ray.core.app.router";
2017-02-03 22:15:10 +00:00
option java_multiple_files = true;
2016-10-11 21:02:44 +00:00
import "google/protobuf/any.proto";
import "common/net/port.proto";
import "common/net/network.proto";
import "common/protoext/extensions.proto";
import "app/router/routercommon/common.proto";
2016-10-11 21:02:44 +00:00
2017-11-05 16:19:34 +00:00
2016-10-11 21:02:44 +00:00
message RoutingRule {
2018-11-07 20:08:20 +00:00
oneof target_tag {
// Tag of outbound that this rule is pointing to.
string tag = 1;
// Tag of routing balancer.
string balancing_tag = 12;
}
2018-11-01 09:39:03 +00:00
// List of domains for target domain matching.
repeated v2ray.core.app.router.routercommon.Domain domain = 2;
// List of CIDRs for target IP address matching.
2019-02-24 22:43:00 +00:00
// Deprecated. Use geoip below.
repeated v2ray.core.app.router.routercommon.CIDR cidr = 3 [deprecated = true];
// List of GeoIPs for target IP address matching. If this entry exists, the
// cidr above will have no effect. GeoIP fields with the same country code are
// supposed to contain exactly same content. They will be merged during
// runtime. For customized GeoIPs, please leave country code empty.
repeated v2ray.core.app.router.routercommon.GeoIP geoip = 10;
// A range of port [from, to]. If the destination port is in this range, this
// rule takes effect. Deprecated. Use port_list.
2019-02-24 22:43:00 +00:00
v2ray.core.common.net.PortRange port_range = 4 [deprecated = true];
// List of ports.
v2ray.core.common.net.PortList port_list = 14;
2018-11-20 15:58:26 +00:00
// List of networks. Deprecated. Use networks.
v2ray.core.common.net.NetworkList network_list = 5 [deprecated = true];
// List of networks for matching.
repeated v2ray.core.common.net.Network networks = 13;
// List of CIDRs for source IP address matching.
repeated v2ray.core.app.router.routercommon.CIDR source_cidr = 6 [deprecated = true];
// List of GeoIPs for source IP address matching. If this entry exists, the
// source_cidr above will have no effect.
repeated v2ray.core.app.router.routercommon.GeoIP source_geoip = 11;
// List of ports for source port matching.
v2ray.core.common.net.PortList source_port_list = 16;
2016-10-18 21:01:39 +00:00
repeated string user_email = 7;
2016-11-13 20:23:34 +00:00
repeated string inbound_tag = 8;
2018-07-16 11:47:00 +00:00
repeated string protocol = 9;
string attributes = 15;
2021-03-03 22:23:52 +00:00
string domain_matcher = 17;
2021-09-07 07:42:34 +00:00
// geo_domain instruct simplified config loader to load geo domain rule and fill in domain field.
repeated v2ray.core.app.router.routercommon.GeoSite geo_domain = 68001;
2016-10-11 21:02:44 +00:00
}
2018-11-07 20:08:20 +00:00
message BalancingRule {
string tag = 1;
repeated string outbound_selector = 2;
2021-04-08 19:55:25 +00:00
string strategy = 3;
2021-06-19 13:36:54 +00:00
google.protobuf.Any strategy_settings = 4;
string fallback_tag = 5;
}
message StrategyWeight {
bool regexp = 1;
string match = 2;
float value = 3;
}
2021-09-07 10:48:24 +00:00
message StrategyRandomConfig {
option (v2ray.core.common.protoext.message_opt).type = "balancer";
option (v2ray.core.common.protoext.message_opt).short_name = "random";
}
message StrategyLeastPingConfig {
2021-09-07 10:48:24 +00:00
option (v2ray.core.common.protoext.message_opt).type = "balancer";
option (v2ray.core.common.protoext.message_opt).short_name = "leastping";
string observer_tag = 7;
}
message StrategyLeastLoadConfig {
2021-09-07 10:48:24 +00:00
option (v2ray.core.common.protoext.message_opt).type = "balancer";
option (v2ray.core.common.protoext.message_opt).short_name = "leastload";
// weight settings
repeated StrategyWeight costs = 2;
// RTT baselines for selecting, int64 values of time.Duration
repeated int64 baselines = 3;
// expected nodes count to select
int32 expected = 4;
// max acceptable rtt, filter away high delay nodes. defalut 0
int64 maxRTT = 5;
// acceptable failure rate
float tolerance = 6;
string observer_tag = 7;
}
enum DomainStrategy {
// Use domain as is.
AsIs = 0;
2016-10-18 08:31:39 +00:00
// Always resolve IP for domains.
UseIp = 1;
2016-10-18 08:31:39 +00:00
// Resolve to IP if the domain doesn't match any rules.
IpIfNonMatch = 2;
2017-11-15 11:55:47 +00:00
// Resolve to IP if any rule requires IP matching.
IpOnDemand = 3;
}
message Config {
2016-10-11 21:02:44 +00:00
DomainStrategy domain_strategy = 1;
repeated RoutingRule rule = 2;
2018-11-07 20:08:20 +00:00
repeated BalancingRule balancing_rule = 3;
2018-01-04 10:09:23 +00:00
}
2021-09-09 13:45:19 +00:00
message SimplifiedRoutingRule {
oneof target_tag {
// Tag of outbound that this rule is pointing to.
string tag = 1;
// Tag of routing balancer.
string balancing_tag = 12;
}
// List of domains for target domain matching.
repeated v2ray.core.app.router.routercommon.Domain domain = 2;
// List of GeoIPs for target IP address matching. If this entry exists, the
// cidr above will have no effect. GeoIP fields with the same country code are
// supposed to contain exactly same content. They will be merged during
// runtime. For customized GeoIPs, please leave country code empty.
repeated v2ray.core.app.router.routercommon.GeoIP geoip = 10;
// List of ports.
string port_list = 14;
// List of networks for matching.
string networks = 13;
// List of GeoIPs for source IP address matching. If this entry exists, the
// source_cidr above will have no effect.
repeated v2ray.core.app.router.routercommon.GeoIP source_geoip = 11;
// List of ports for source port matching.
string source_port_list = 16;
repeated string user_email = 7;
repeated string inbound_tag = 8;
repeated string protocol = 9;
string attributes = 15;
string domain_matcher = 17;
// geo_domain instruct simplified config loader to load geo domain rule and fill in domain field.
repeated v2ray.core.app.router.routercommon.GeoSite geo_domain = 68001;
}
message SimplifiedConfig {
option (v2ray.core.common.protoext.message_opt).type = "service";
option (v2ray.core.common.protoext.message_opt).short_name = "router";
DomainStrategy domain_strategy = 1;
2021-09-09 13:45:19 +00:00
repeated SimplifiedRoutingRule rule = 2;
repeated BalancingRule balancing_rule = 3;
}