config.proto 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. syntax = "proto3";
  2. package v2ray.core;
  3. option go_package = "core";
  4. option java_package = "com.v2ray.core";
  5. option java_outer_classname = "ConfigProto";
  6. import "v2ray.com/core/app/router/config.proto";
  7. import "v2ray.com/core/app/dns/config.proto";
  8. import "v2ray.com/core/common/loader/type.proto";
  9. import "v2ray.com/core/common/net/port.proto";
  10. import "v2ray.com/core/common/net/address.proto";
  11. import "v2ray.com/core/common/log/config.proto";
  12. import "v2ray.com/core/transport/internet/config.proto";
  13. import "v2ray.com/core/transport/config.proto";
  14. enum ConfigFormat {
  15. Protobuf = 0;
  16. JSON = 1;
  17. }
  18. message AllocationStrategyConcurrency {
  19. uint32 value = 1;
  20. }
  21. message AllocationStrategyRefresh {
  22. uint32 value = 1;
  23. }
  24. message AllocationStrategy {
  25. enum Type {
  26. // Always allocate all connection handlers.
  27. Always = 0;
  28. // Randomly allocate specific range of handlers.
  29. Random = 1;
  30. // External. Not supported yet.
  31. External = 2;
  32. }
  33. Type type = 1;
  34. // Number of handlers (ports) running in parallel.
  35. AllocationStrategyConcurrency concurrency = 2;
  36. // Number of minutes before a handler is regenerated.
  37. AllocationStrategyRefresh refresh = 3;
  38. }
  39. // Config for an inbound connection handler.
  40. message InboundConnectionConfig {
  41. v2ray.core.common.loader.TypedSettings settings = 1;
  42. v2ray.core.common.net.PortRange port_range = 2;
  43. v2ray.core.common.net.IPOrDomain listen_on = 3;
  44. string tag = 4;
  45. AllocationStrategy allocation_strategy = 5;
  46. v2ray.core.transport.internet.StreamConfig stream_settings = 6;
  47. bool allow_passive_connection = 7;
  48. }
  49. message OutboundConnectionConfig {
  50. v2ray.core.common.loader.TypedSettings settings = 1;
  51. v2ray.core.common.net.IPOrDomain send_through = 2;
  52. v2ray.core.transport.internet.StreamConfig stream_settings = 3;
  53. string tag = 4;
  54. }
  55. message Config {
  56. repeated InboundConnectionConfig inbound = 1;
  57. repeated OutboundConnectionConfig outbound = 2;
  58. v2ray.core.common.log.Config log = 3;
  59. v2ray.core.app.router.Config router = 4;
  60. v2ray.core.app.dns.Config dns = 5;
  61. v2ray.core.transport.Config transport = 6;
  62. }