1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-20 23:47:21 -05:00
v2fly/app/router/config.proto

86 lines
1.7 KiB
Protocol Buffer
Raw Normal View History

2016-10-11 23:02:44 +02:00
syntax = "proto3";
2016-10-12 16:11:13 +02:00
package v2ray.core.app.router;
2016-12-23 00:24:28 +01:00
option csharp_namespace = "V2Ray.Core.App.Router";
2016-10-12 16:11:13 +02:00
option go_package = "router";
option java_package = "com.v2ray.core.app.router";
2017-02-03 23:15:10 +01:00
option java_multiple_files = true;
2016-10-11 23:02:44 +02:00
import "v2ray.com/core/common/net/port.proto";
import "v2ray.com/core/common/net/network.proto";
// Domain for routing decision.
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;
2017-05-08 12:18:13 +02:00
// The value is a domain.
Domain = 2;
2016-10-11 23:02:44 +02:00
}
// Domain matching type.
Type type = 1;
// Domain value.
string value = 2;
}
2016-10-18 16:42:22 +02:00
// IP for routing decision, in CIDR form.
message CIDR {
2016-10-11 23:02:44 +02:00
// IP address, should be either 4 or 16 bytes.
bytes ip = 1;
2016-10-18 16:42:22 +02:00
// Number of leading ones in the network mask.
uint32 prefix = 2;
2016-10-11 23:02:44 +02:00
}
2017-11-02 10:54:06 +01:00
message GeoIP {
string country_code = 1;
repeated CIDR cidr = 2;
}
message GeoIPList {
repeated GeoIP entry = 1;
}
2017-11-05 17:19:34 +01:00
message GeoSite {
string country_code = 1;
repeated Domain domain = 2;
}
message GeoSiteList{
repeated GeoSite entry = 1;
}
2016-10-11 23:02:44 +02:00
message RoutingRule {
string tag = 1;
repeated Domain domain = 2;
2016-10-18 16:42:22 +02:00
repeated CIDR cidr = 3;
2016-10-11 23:02:44 +02:00
v2ray.core.common.net.PortRange port_range = 4;
v2ray.core.common.net.NetworkList network_list = 5;
2016-10-18 23:01:39 +02:00
repeated CIDR source_cidr = 6;
repeated string user_email = 7;
2016-11-13 21:23:34 +01:00
repeated string inbound_tag = 8;
2016-10-11 23:02:44 +02:00
}
message Config {
enum DomainStrategy {
2016-10-18 10:31:39 +02:00
// Use domain as is.
2016-10-11 23:02:44 +02:00
AsIs = 0;
2016-10-18 10:31:39 +02:00
// Always resolve IP for domains.
2016-10-11 23:02:44 +02:00
UseIp = 1;
2016-10-18 10:31:39 +02:00
// Resolve to IP if the domain doesn't match any rules.
2016-10-11 23:02:44 +02:00
IpIfNonMatch = 2;
2017-11-15 12:55:47 +01:00
// Resolve to IP if any rule requires IP matching.
IpOnDemand = 3;
2016-10-11 23:02:44 +02:00
}
DomainStrategy domain_strategy = 1;
repeated RoutingRule rule = 2;
2018-01-04 11:09:23 +01:00
}