config.proto 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. syntax = "proto3";
  2. package v2ray.core.app.router;
  3. option go_package = "router";
  4. option java_package = "com.v2ray.core.app.router";
  5. option java_outer_classname = "ConfigProto";
  6. import "v2ray.com/core/common/net/port.proto";
  7. import "v2ray.com/core/common/net/network.proto";
  8. // Domain for routing decision.
  9. message Domain {
  10. // Type of domain value.
  11. enum Type {
  12. // The value is used as is.
  13. Plain = 0;
  14. // The value is used as a regular expression.
  15. Regex = 1;
  16. }
  17. // Domain matching type.
  18. Type type = 1;
  19. // Domain value.
  20. string value = 2;
  21. }
  22. // IP for routing decision, in CIDR form.
  23. message CIDR {
  24. // IP address, should be either 4 or 16 bytes.
  25. bytes ip = 1;
  26. // Number of leading ones in the network mask.
  27. uint32 prefix = 2;
  28. }
  29. message RoutingRule {
  30. string tag = 1;
  31. repeated Domain domain = 2;
  32. repeated CIDR cidr = 3;
  33. v2ray.core.common.net.PortRange port_range = 4;
  34. v2ray.core.common.net.NetworkList network_list = 5;
  35. repeated CIDR source_cidr = 6;
  36. repeated string user_email = 7;
  37. }
  38. message Config {
  39. enum DomainStrategy {
  40. // Use domain as is.
  41. AsIs = 0;
  42. // Always resolve IP for domains.
  43. UseIp = 1;
  44. // Resolve to IP if the domain doesn't match any rules.
  45. IpIfNonMatch = 2;
  46. }
  47. DomainStrategy domain_strategy = 1;
  48. repeated RoutingRule rule = 2;
  49. }