2016-10-11 17:02:44 -04:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2016-10-12 10:11:13 -04:00
|
|
|
package v2ray.core.app.router;
|
|
|
|
option go_package = "router";
|
|
|
|
option java_package = "com.v2ray.core.app.router";
|
2016-10-11 17:02:44 -04:00
|
|
|
option java_outer_classname = "ConfigProto";
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Domain matching type.
|
|
|
|
Type type = 1;
|
|
|
|
|
|
|
|
// Domain value.
|
|
|
|
string value = 2;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
message RoutingRule {
|
|
|
|
string tag = 1;
|
|
|
|
repeated Domain domain = 2;
|
2016-10-18 10:42:22 -04:00
|
|
|
repeated CIDR cidr = 3;
|
2016-10-11 17:02:44 -04:00
|
|
|
v2ray.core.common.net.PortRange port_range = 4;
|
|
|
|
v2ray.core.common.net.NetworkList network_list = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
DomainStrategy domain_strategy = 1;
|
|
|
|
repeated RoutingRule rule = 2;
|
|
|
|
}
|