config.proto 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. syntax = "proto3";
  2. package v2ray.core.transport.internet;
  3. option csharp_namespace = "V2Ray.Core.Transport.Internet";
  4. option go_package = "github.com/v2fly/v2ray-core/v4/transport/internet";
  5. option java_package = "com.v2ray.core.transport.internet";
  6. option java_multiple_files = true;
  7. import "google/protobuf/any.proto";
  8. import "common/protoext/extensions.proto";
  9. enum TransportProtocol {
  10. TCP = 0;
  11. UDP = 1;
  12. MKCP = 2;
  13. WebSocket = 3;
  14. HTTP = 4;
  15. DomainSocket = 5;
  16. }
  17. message TransportConfig {
  18. // Type of network that this settings supports.
  19. // Deprecated. Use the string form below.
  20. TransportProtocol protocol = 1 [ deprecated = true ];
  21. // Type of network that this settings supports.
  22. string protocol_name = 3;
  23. // Specific settings. Must be of the transports.
  24. google.protobuf.Any settings = 2;
  25. }
  26. message StreamConfig {
  27. // Effective network. Deprecated. Use the string form below.
  28. TransportProtocol protocol = 1 [ deprecated = true ];
  29. // Effective network.
  30. string protocol_name = 5;
  31. repeated TransportConfig transport_settings = 2;
  32. // Type of security. Must be a message name of the settings proto.
  33. string security_type = 3;
  34. // Settings for transport security. For now the only choice is TLS.
  35. repeated google.protobuf.Any security_settings = 4;
  36. SocketConfig socket_settings = 6;
  37. }
  38. message ProxyConfig {
  39. string tag = 1;
  40. bool transportLayerProxy = 2;
  41. }
  42. // SocketConfig is options to be applied on network sockets.
  43. message SocketConfig {
  44. // Mark of the connection. If non-zero, the value will be set to SO_MARK.
  45. int32 mark = 1;
  46. enum TCPFastOpenState {
  47. // AsIs is to leave the current TFO state as is, unmodified.
  48. AsIs = 0;
  49. // Enable is for enabling TFO explictly.
  50. Enable = 1;
  51. // Disable is for disabling TFO explictly.
  52. Disable = 2;
  53. }
  54. // TFO is the state of TFO settings.
  55. TCPFastOpenState tfo = 2;
  56. enum TProxyMode {
  57. // TProxy is off.
  58. Off = 0;
  59. // TProxy mode.
  60. TProxy = 1;
  61. // Redirect mode.
  62. Redirect = 2;
  63. }
  64. // TProxy is for enabling TProxy socket option.
  65. TProxyMode tproxy = 3;
  66. // ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket
  67. // option. This option is for UDP only.
  68. bool receive_original_dest_address = 4;
  69. bytes bind_address = 5;
  70. uint32 bind_port = 6;
  71. bool accept_proxy_protocol = 7;
  72. int32 tcp_keep_alive_interval = 8;
  73. }
  74. message NoneSecurity {
  75. option (v2ray.core.common.protoext.message_opt).type = "security";
  76. option (v2ray.core.common.protoext.message_opt).short_name = "none";
  77. }