config.proto 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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_multiple_files = true;
  7. import "v2ray.com/core/common/serial/typed_message.proto";
  8. import "v2ray.com/core/transport/config.proto";
  9. // Configuration serialization format.
  10. enum ConfigFormat {
  11. Protobuf = 0;
  12. JSON = 1;
  13. }
  14. // Master config of V2Ray. V2Ray takes this config as input and functions accordingly.
  15. message Config {
  16. // Inbound handler configurations. Must have at least one item.
  17. repeated InboundHandlerConfig inbound = 1;
  18. // Outbound handler configurations. Must have at least one item. The first item is used as default for routing.
  19. repeated OutboundHandlerConfig outbound = 2;
  20. reserved 3;
  21. // App configuration. Must be one in the app directory.
  22. repeated v2ray.core.common.serial.TypedMessage app = 4;
  23. // Transport settings.
  24. v2ray.core.transport.Config transport = 5;
  25. // Configuration for extensions. The config may not work if corresponding extension is not loaded into V2Ray.
  26. // V2Ray will ignore such config during initialization.
  27. repeated v2ray.core.common.serial.TypedMessage extension = 6;
  28. }
  29. message InboundHandlerConfig {
  30. // Tag of the inbound handler.
  31. string tag = 1;
  32. // Settings for how this inbound proxy is handled. Must be ReceiverConfig above.
  33. v2ray.core.common.serial.TypedMessage receiver_settings = 2;
  34. // Settings for inbound proxy. Must be one of the inbound proxies.
  35. v2ray.core.common.serial.TypedMessage proxy_settings = 3;
  36. }
  37. message OutboundHandlerConfig {
  38. // Tag of this outbound handler.
  39. string tag = 1;
  40. // Settings for how to dial connection for this outbound handler. Must be SenderConfig above.
  41. v2ray.core.common.serial.TypedMessage sender_settings = 2;
  42. // Settings for this outbound proxy. Must be one of the outbound proxies.
  43. v2ray.core.common.serial.TypedMessage proxy_settings = 3;
  44. // If not zero, this outbound will be expired in seconds. Not used for now.
  45. int64 expire = 4;
  46. // Comment of this outbound handler. Not used for now.
  47. string comment = 5;
  48. }