config.proto 1.5 KB

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