1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-23 10:37:09 -05:00
v2fly/app/router/config.proto

151 lines
3.6 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 "common/net/port.proto";
import "common/net/network.proto";
2016-10-11 17:02:44 -04:00
// Domain for routing decision.
2016-10-11 17:02:44 -04:00
message Domain {
// Type of domain value.
enum Type {
// The value is used as is.
Plain = 0;
// The value is used as a regular expression.
Regex = 1;
2018-08-21 15:30:32 -04:00
// The value is a root domain.
2017-05-08 06:18:13 -04:00
Domain = 2;
2018-08-21 15:30:32 -04:00
// The value is a domain.
Full = 3;
2016-10-11 17:02:44 -04:00
}
// Domain matching type.
Type type = 1;
// Domain value.
string value = 2;
2018-12-01 15:02:36 -05:00
message Attribute {
string key = 1;
oneof typed_value {
bool bool_value = 2;
int64 int_value = 3;
}
}
// Attributes of this domain. May be used for filtering.
repeated Attribute attribute = 3;
2016-10-11 17:02:44 -04:00
}
2016-10-18 10:42:22 -04:00
// IP for routing decision, in CIDR form.
message CIDR {
2016-10-11 17:02:44 -04:00
// IP address, should be either 4 or 16 bytes.
bytes ip = 1;
2016-10-18 10:42:22 -04:00
// Number of leading ones in the network mask.
uint32 prefix = 2;
2016-10-11 17:02:44 -04:00
}
2017-11-02 05:54:06 -04:00
message GeoIP {
string country_code = 1;
repeated CIDR cidr = 2;
bool reverse_match = 3;
2017-11-02 05:54:06 -04:00
}
message GeoIPList {
repeated GeoIP entry = 1;
}
2017-11-05 11:19:34 -05:00
message GeoSite {
string country_code = 1;
repeated Domain domain = 2;
}
message GeoSiteList {
2017-11-05 11:19:34 -05:00
repeated GeoSite entry = 1;
}
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.
2016-10-11 17:02:44 -04:00
repeated Domain domain = 2;
// List of CIDRs for target IP address matching.
2019-02-24 17:43:00 -05:00
// Deprecated. Use geoip below.
repeated 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 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 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 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;
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;
2018-11-07 15:08:20 -05:00
}
2016-10-11 17:02:44 -04:00
message Config {
enum DomainStrategy {
2016-10-18 04:31:39 -04:00
// Use domain as is.
2016-10-11 17:02:44 -04:00
AsIs = 0;
2016-10-18 04:31:39 -04:00
// Always resolve IP for domains.
2016-10-11 17:02:44 -04:00
UseIp = 1;
2016-10-18 04:31:39 -04:00
// Resolve to IP if the domain doesn't match any rules.
2016-10-11 17:02:44 -04:00
IpIfNonMatch = 2;
2017-11-15 06:55:47 -05:00
// Resolve to IP if any rule requires IP matching.
IpOnDemand = 3;
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
}