config.proto 1.9 KB

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