config.proto 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. }
  18. // Domain matching type.
  19. Type type = 1;
  20. // Domain value.
  21. string value = 2;
  22. }
  23. // IP for routing decision, in CIDR form.
  24. message CIDR {
  25. // IP address, should be either 4 or 16 bytes.
  26. bytes ip = 1;
  27. // Number of leading ones in the network mask.
  28. uint32 prefix = 2;
  29. }
  30. message RoutingRule {
  31. string tag = 1;
  32. repeated Domain domain = 2;
  33. repeated CIDR cidr = 3;
  34. v2ray.core.common.net.PortRange port_range = 4;
  35. v2ray.core.common.net.NetworkList network_list = 5;
  36. repeated CIDR source_cidr = 6;
  37. repeated string user_email = 7;
  38. repeated string inbound_tag = 8;
  39. }
  40. message Config {
  41. enum DomainStrategy {
  42. // Use domain as is.
  43. AsIs = 0;
  44. // Always resolve IP for domains.
  45. UseIp = 1;
  46. // Resolve to IP if the domain doesn't match any rules.
  47. IpIfNonMatch = 2;
  48. }
  49. DomainStrategy domain_strategy = 1;
  50. repeated RoutingRule rule = 2;
  51. }