config.proto 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. // Configuration serialization format.
  13. enum ConfigFormat {
  14. Protobuf = 0;
  15. JSON = 1;
  16. }
  17. message AllocationStrategyConcurrency {
  18. uint32 value = 1;
  19. }
  20. message AllocationStrategyRefresh {
  21. uint32 value = 1;
  22. }
  23. message AllocationStrategy {
  24. enum Type {
  25. // Always allocate all connection handlers.
  26. Always = 0;
  27. // Randomly allocate specific range of handlers.
  28. Random = 1;
  29. // External. Not supported yet.
  30. External = 2;
  31. }
  32. Type type = 1;
  33. // Number of handlers (ports) running in parallel.
  34. // Default value is 3 if unset.
  35. AllocationStrategyConcurrency concurrency = 2;
  36. // Number of minutes before a handler is regenerated.
  37. // Default value is 5 if unset.
  38. AllocationStrategyRefresh refresh = 3;
  39. }
  40. // Config for an inbound connection handler.
  41. message InboundConnectionConfig {
  42. // Protocol specific settings. Must be one of the supported protocols.
  43. v2ray.core.common.loader.TypedSettings settings = 1;
  44. // Range of port number to run on. Both inclusive.
  45. v2ray.core.common.net.PortRange port_range = 2;
  46. // IP address to listen on. 0.0.0.0 if unset.
  47. v2ray.core.common.net.IPOrDomain listen_on = 3;
  48. // Tag of this handler.
  49. string tag = 4;
  50. AllocationStrategy allocation_strategy = 5;
  51. v2ray.core.transport.internet.StreamConfig stream_settings = 6;
  52. bool allow_passive_connection = 7;
  53. }
  54. // Config for an outbound connection handler.
  55. message OutboundConnectionConfig {
  56. v2ray.core.common.loader.TypedSettings settings = 1;
  57. // IP address to send data through. 0.0.0.0 if unset.
  58. v2ray.core.common.net.IPOrDomain send_through = 2;
  59. v2ray.core.transport.internet.StreamConfig stream_settings = 3;
  60. v2ray.core.transport.internet.ProxyConfig proxy_settings = 5;
  61. string tag = 4;
  62. }
  63. message Config {
  64. // Inbound handler configurations. Must have at least one item.
  65. repeated InboundConnectionConfig inbound = 1;
  66. // Outbound handler configurations. Must have at least one item. The first item is used as default for routing.
  67. repeated OutboundConnectionConfig outbound = 2;
  68. v2ray.core.common.log.Config log = 3;
  69. // App configuration. Must be one in the app directory.
  70. repeated v2ray.core.common.loader.TypedSettings app = 4;
  71. v2ray.core.transport.Config transport = 5;
  72. }