config.proto 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 root domain.
  18. Domain = 2;
  19. // The value is a domain.
  20. Full = 3;
  21. }
  22. // Domain matching type.
  23. Type type = 1;
  24. // Domain value.
  25. string value = 2;
  26. }
  27. // IP for routing decision, in CIDR form.
  28. message CIDR {
  29. // IP address, should be either 4 or 16 bytes.
  30. bytes ip = 1;
  31. // Number of leading ones in the network mask.
  32. uint32 prefix = 2;
  33. }
  34. message GeoIP {
  35. string country_code = 1;
  36. repeated CIDR cidr = 2;
  37. }
  38. message GeoIPList {
  39. repeated GeoIP entry = 1;
  40. }
  41. message GeoSite {
  42. string country_code = 1;
  43. repeated Domain domain = 2;
  44. }
  45. message GeoSiteList{
  46. repeated GeoSite entry = 1;
  47. }
  48. message RoutingRule {
  49. string tag = 1;
  50. repeated Domain domain = 2;
  51. repeated CIDR cidr = 3;
  52. v2ray.core.common.net.PortRange port_range = 4;
  53. v2ray.core.common.net.NetworkList network_list = 5;
  54. repeated CIDR source_cidr = 6;
  55. repeated string user_email = 7;
  56. repeated string inbound_tag = 8;
  57. repeated string protocol = 9;
  58. }
  59. message Config {
  60. enum DomainStrategy {
  61. // Use domain as is.
  62. AsIs = 0;
  63. // Always resolve IP for domains.
  64. UseIp = 1;
  65. // Resolve to IP if the domain doesn't match any rules.
  66. IpIfNonMatch = 2;
  67. // Resolve to IP if any rule requires IP matching.
  68. IpOnDemand = 3;
  69. }
  70. DomainStrategy domain_strategy = 1;
  71. repeated RoutingRule rule = 2;
  72. }