config.proto 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 GeoSite {
  40. string country_code = 1;
  41. repeated Domain domain = 2;
  42. }
  43. message GeoSiteList{
  44. repeated GeoSite entry = 1;
  45. }
  46. message RoutingRule {
  47. string tag = 1;
  48. repeated Domain domain = 2;
  49. repeated CIDR cidr = 3;
  50. v2ray.core.common.net.PortRange port_range = 4;
  51. v2ray.core.common.net.NetworkList network_list = 5;
  52. repeated CIDR source_cidr = 6;
  53. repeated string user_email = 7;
  54. repeated string inbound_tag = 8;
  55. }
  56. message Config {
  57. enum DomainStrategy {
  58. // Use domain as is.
  59. AsIs = 0;
  60. // Always resolve IP for domains.
  61. UseIp = 1;
  62. // Resolve to IP if the domain doesn't match any rules.
  63. IpIfNonMatch = 2;
  64. // Resolve to IP if any rule requires IP matching.
  65. IpOnDemand = 3;
  66. }
  67. DomainStrategy domain_strategy = 1;
  68. repeated RoutingRule rule = 2;
  69. }