Files

111 lines
2.7 KiB
Protocol Buffer
Raw Permalink Normal View History

2020-11-25 19:01:53 +08:00
syntax = "proto3";
package xray.app.router;
option csharp_namespace = "Xray.App.Router";
2020-12-04 09:36:16 +08:00
option go_package = "github.com/xtls/xray-core/app/router";
2020-11-25 19:01:53 +08:00
option java_package = "com.xray.app.router";
option java_multiple_files = true;
2024-02-17 22:51:37 -05:00
import "common/serial/typed_message.proto";
2020-11-25 19:01:53 +08:00
import "common/net/port.proto";
import "common/net/network.proto";
2026-04-14 00:42:29 +08:00
import "common/geodata/geodat.proto";
2020-11-25 19:01:53 +08: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;
}
2026-04-14 00:42:29 +08:00
string rule_tag = 19;
2020-11-25 19:01:53 +08:00
// List of domains for target domain matching.
2026-04-14 00:42:29 +08:00
repeated xray.common.geodata.DomainRule domain = 2;
2020-11-25 19:01:53 +08:00
2026-04-14 00:42:29 +08:00
// List of IPs for target IP address matching.
repeated xray.common.geodata.IPRule ip = 10;
2020-11-25 19:01:53 +08:00
2026-04-14 00:42:29 +08:00
// List of ports for target port matching.
2020-11-25 19:01:53 +08:00
xray.common.net.PortList port_list = 14;
// List of networks for matching.
repeated xray.common.net.Network networks = 13;
2026-04-14 00:42:29 +08:00
// List of IPs for source IP address matching.
repeated xray.common.geodata.IPRule source_ip = 11;
2020-11-25 19:01:53 +08: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;
2023-05-21 11:26:22 -04:00
map<string, string> attributes = 15;
2026-04-14 00:42:29 +08:00
// List of IPs for local IP address matching.
repeated xray.common.geodata.IPRule local_ip = 17;
// List of ports for local port matching.
xray.common.net.PortList local_port_list = 18;
xray.common.net.PortList vless_route_list = 20;
2026-04-14 00:42:29 +08:00
repeated string process = 21;
2026-03-07 13:49:46 +03:00
WebhookConfig webhook = 22;
}
message WebhookConfig {
string url = 1;
uint32 deduplication = 2;
map<string, string> headers = 3;
2020-11-25 19:01:53 +08:00
}
message BalancingRule {
string tag = 1;
repeated string outbound_selector = 2;
string strategy = 3;
2024-02-17 22:51:37 -05:00
xray.common.serial.TypedMessage strategy_settings = 4;
string fallback_tag = 5;
}
message StrategyWeight {
bool regexp = 1;
string match = 2;
float value =3;
}
message StrategyLeastLoadConfig {
// 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;
2024-04-18 12:20:07 +08:00
// max acceptable rtt, filter away high delay nodes. default 0
2024-02-17 22:51:37 -05:00
int64 maxRTT = 5;
// acceptable failure rate
float tolerance = 6;
2020-11-25 19:01:53 +08:00
}
message Config {
enum DomainStrategy {
// Use domain as is.
AsIs = 0;
2026-04-14 00:42:29 +08:00
reserved 1;
2020-11-25 19:01:53 +08:00
// 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;
}