config.proto 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. syntax = "proto3";
  2. package v2ray.core;
  3. option csharp_namespace = "V2Ray.Core";
  4. option go_package = "core";
  5. option java_package = "com.v2ray.core";
  6. option java_outer_classname = "ConfigProto";
  7. import "v2ray.com/core/common/serial/typed_message.proto";
  8. import "v2ray.com/core/common/net/port.proto";
  9. import "v2ray.com/core/common/net/address.proto";
  10. import "v2ray.com/core/common/log/config.proto";
  11. import "v2ray.com/core/transport/internet/config.proto";
  12. import "v2ray.com/core/transport/config.proto";
  13. // Configuration serialization format.
  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. // Default value is 3 if unset.
  36. AllocationStrategyConcurrency concurrency = 2;
  37. // Number of minutes before a handler is regenerated.
  38. // Default value is 5 if unset.
  39. AllocationStrategyRefresh refresh = 3;
  40. }
  41. // Config for an inbound connection handler.
  42. message InboundConnectionConfig {
  43. // Protocol specific settings. Must be one of the supported protocols.
  44. v2ray.core.common.serial.TypedMessage settings = 1;
  45. // Range of port number to run on. Both inclusive.
  46. v2ray.core.common.net.PortRange port_range = 2;
  47. // IP address to listen on. 0.0.0.0 if unset.
  48. v2ray.core.common.net.IPOrDomain listen_on = 3;
  49. // Tag of this handler.
  50. string tag = 4;
  51. AllocationStrategy allocation_strategy = 5;
  52. v2ray.core.transport.internet.StreamConfig stream_settings = 6;
  53. bool allow_passive_connection = 7;
  54. }
  55. // Config for an outbound connection handler.
  56. message OutboundConnectionConfig {
  57. v2ray.core.common.serial.TypedMessage settings = 1;
  58. // IP address to send data through. 0.0.0.0 if unset.
  59. v2ray.core.common.net.IPOrDomain send_through = 2;
  60. v2ray.core.transport.internet.StreamConfig stream_settings = 3;
  61. v2ray.core.transport.internet.ProxyConfig proxy_settings = 5;
  62. string tag = 4;
  63. }
  64. message Config {
  65. // Inbound handler configurations. Must have at least one item.
  66. repeated InboundConnectionConfig inbound = 1;
  67. // Outbound handler configurations. Must have at least one item. The first item is used as default for routing.
  68. repeated OutboundConnectionConfig outbound = 2;
  69. v2ray.core.common.log.Config log = 3;
  70. // App configuration. Must be one in the app directory.
  71. repeated v2ray.core.common.serial.TypedMessage app = 4;
  72. v2ray.core.transport.Config transport = 5;
  73. }