1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-17 18:06:15 -05:00
v2fly/app/router/config.proto

144 lines
4.3 KiB
Protocol Buffer
Raw Normal View History

2016-10-11 17:02:44 -04:00
syntax = "proto3";
2016-10-12 10:11:13 -04:00
package v2ray.core.app.router;
2016-12-22 18:24:28 -05:00
option csharp_namespace = "V2Ray.Core.App.Router";
2021-02-16 15:31:50 -05:00
option go_package = "github.com/v2fly/v2ray-core/v4/app/router";
2016-10-12 10:11:13 -04:00
option java_package = "com.v2ray.core.app.router";
2017-02-03 17:15:10 -05:00
option java_multiple_files = true;
2016-10-11 17:02:44 -04: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 17:02:44 -04:00
2017-11-05 11:19:34 -05:00
2016-10-11 17:02:44 -04:00
message RoutingRule {
2018-11-07 15:08:20 -05: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 05:39:03 -04: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 17:43:00 -05: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 17:43:00 -05: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 10:58:26 -05: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 17:01:39 -04:00
repeated string user_email = 7;
2016-11-13 15:23:34 -05:00
repeated string inbound_tag = 8;
2018-07-16 07:47:00 -04:00
repeated string protocol = 9;
string attributes = 15;
2021-03-03 17:23:52 -05:00
string domain_matcher = 17;
2021-09-07 03:42:34 -04: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 17:02:44 -04:00
}
2018-11-07 15:08:20 -05:00
message BalancingRule {
string tag = 1;
repeated string outbound_selector = 2;
2021-04-08 15:55:25 -04:00
string strategy = 3;
2021-06-19 09:36:54 -04: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 06:48:24 -04: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 06:48:24 -04: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 06:48:24 -04: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 04:31:39 -04:00
// Always resolve IP for domains.
UseIp = 1;
2016-10-18 04:31:39 -04:00
// Resolve to IP if the domain doesn't match any rules.
IpIfNonMatch = 2;
2017-11-15 06:55:47 -05:00
// Resolve to IP if any rule requires IP matching.
IpOnDemand = 3;
}
message Config {
2016-10-11 17:02:44 -04:00
DomainStrategy domain_strategy = 1;
repeated RoutingRule rule = 2;
2018-11-07 15:08:20 -05:00
repeated BalancingRule balancing_rule = 3;
2018-01-04 05:09:23 -05:00
}
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;
repeated RoutingRule rule = 2;
repeated BalancingRule balancing_rule = 3;
}