config.proto 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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/v5/transport/internet";
  5. option java_package = "com.v2ray.core.transport.internet";
  6. option java_multiple_files = true;
  7. import "google/protobuf/any.proto";
  8. enum TransportProtocol {
  9. TCP = 0;
  10. UDP = 1;
  11. MKCP = 2;
  12. WebSocket = 3;
  13. HTTP = 4;
  14. DomainSocket = 5;
  15. }
  16. message TransportConfig {
  17. // Type of network that this settings supports.
  18. // Deprecated. Use the string form below.
  19. TransportProtocol protocol = 1 [ deprecated = true ];
  20. // Type of network that this settings supports.
  21. string protocol_name = 3;
  22. // Specific settings. Must be of the transports.
  23. google.protobuf.Any settings = 2;
  24. }
  25. message StreamConfig {
  26. // Effective network. Deprecated. Use the string form below.
  27. TransportProtocol protocol = 1 [ deprecated = true ];
  28. // Effective network.
  29. string protocol_name = 5;
  30. repeated TransportConfig transport_settings = 2;
  31. // Type of security. Must be a message name of the settings proto.
  32. string security_type = 3;
  33. // Settings for transport security. For now the only choice is TLS.
  34. repeated google.protobuf.Any security_settings = 4;
  35. SocketConfig socket_settings = 6;
  36. }
  37. message ProxyConfig {
  38. string tag = 1;
  39. bool transportLayerProxy = 2;
  40. }
  41. // MPTCP is the state of MPTCP settings.
  42. // Define it here to avoid conflict with TCPFastOpenState.
  43. enum MPTCPState {
  44. // AsIs is to leave the current MPTCP state as is, unmodified.
  45. AsIs = 0;
  46. // Enable is for enabling MPTCP explictly.
  47. Enable = 1;
  48. // Disable is for disabling MPTCP explictly.
  49. Disable = 2;
  50. }
  51. // SocketConfig is options to be applied on network sockets.
  52. message SocketConfig {
  53. // Mark of the connection. If non-zero, the value will be set to SO_MARK.
  54. uint32 mark = 1;
  55. enum TCPFastOpenState {
  56. // AsIs is to leave the current TFO state as is, unmodified.
  57. AsIs = 0;
  58. // Enable is for enabling TFO explictly.
  59. Enable = 1;
  60. // Disable is for disabling TFO explictly.
  61. Disable = 2;
  62. }
  63. // TFO is the state of TFO settings.
  64. TCPFastOpenState tfo = 2;
  65. enum TProxyMode {
  66. // TProxy is off.
  67. Off = 0;
  68. // TProxy mode.
  69. TProxy = 1;
  70. // Redirect mode.
  71. Redirect = 2;
  72. }
  73. // TProxy is for enabling TProxy socket option.
  74. TProxyMode tproxy = 3;
  75. // ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket
  76. // option. This option is for UDP only.
  77. bool receive_original_dest_address = 4;
  78. bytes bind_address = 5;
  79. uint32 bind_port = 6;
  80. bool accept_proxy_protocol = 7;
  81. int32 tcp_keep_alive_interval = 8;
  82. uint32 tfo_queue_length = 9;
  83. int32 tcp_keep_alive_idle = 10;
  84. string bind_to_device = 11;
  85. int64 rx_buf_size = 12;
  86. int64 tx_buf_size = 13;
  87. bool force_buf_size = 14;
  88. MPTCPState mptcp = 15;
  89. }