Xray-core/app/router/config.proto

91 lines
2.7 KiB
Protocol Buffer
Raw Permalink Normal View History

2020-11-25 11:01:53 +00:00
syntax = "proto3";
package xray.app.router;
option csharp_namespace = "Xray.App.Router";
2020-12-04 01:36:16 +00:00
option go_package = "github.com/xtls/xray-core/app/router";
2020-11-25 11:01:53 +00:00
option java_package = "com.xray.app.router";
option java_multiple_files = true;
import "common/net/port.proto";
import "common/net/network.proto";
2021-03-24 15:01:20 +00:00
import "common/matcher/domain/domain.proto";
import "common/matcher/geoip/geoip.proto";
2020-11-25 11:01:53 +00:00
message RoutingRule {
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.
2021-03-24 15:01:20 +00:00
repeated xray.common.matcher.domain.Domain domain = 2;
2020-11-25 11:01:53 +00:00
// List of CIDRs for target IP address matching.
// Deprecated. Use geoip below.
2021-03-24 15:01:20 +00:00
repeated xray.common.matcher.geoip.CIDR cidr = 3 [deprecated = true];
2020-11-25 11:01:53 +00:00
// 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.
2021-03-24 15:01:20 +00:00
repeated xray.common.matcher.geoip.GeoIP geoip = 10;
2020-11-25 11:01:53 +00:00
// A range of port [from, to]. If the destination port is in this range, this
// rule takes effect. Deprecated. Use port_list.
xray.common.net.PortRange port_range = 4 [deprecated = true];
// List of ports.
xray.common.net.PortList port_list = 14;
// List of networks. Deprecated. Use networks.
xray.common.net.NetworkList network_list = 5 [deprecated = true];
// List of networks for matching.
repeated xray.common.net.Network networks = 13;
// List of CIDRs for source IP address matching.
2021-03-24 15:01:20 +00:00
repeated xray.common.matcher.geoip.CIDR source_cidr = 6 [deprecated = true];
2020-11-25 11:01:53 +00:00
// List of GeoIPs for source IP address matching. If this entry exists, the
// source_cidr above will have no effect.
2021-03-24 15:01:20 +00:00
repeated xray.common.matcher.geoip.GeoIP source_geoip = 11;
2020-11-25 11:01:53 +00:00
// List of ports for source port matching.
xray.common.net.PortList 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;
2020-11-25 11:01:53 +00:00
}
message BalancingRule {
string tag = 1;
repeated string outbound_selector = 2;
}
message Config {
enum DomainStrategy {
// Use domain as is.
AsIs = 0;
// Always resolve IP for domains.
UseIp = 1;
// Resolve to IP if the domain doesn't match any rules.
IpIfNonMatch = 2;
// Resolve to IP if any rule requires IP matching.
IpOnDemand = 3;
}
DomainStrategy domain_strategy = 1;
repeated RoutingRule rule = 2;
repeated BalancingRule balancing_rule = 3;
}