config.proto 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. syntax = "proto3";
  2. package xray.transport.internet;
  3. option csharp_namespace = "Xray.Transport.Internet";
  4. option go_package = "github.com/xtls/xray-core/transport/internet";
  5. option java_package = "com.xray.transport.internet";
  6. option java_multiple_files = true;
  7. import "common/serial/typed_message.proto";
  8. import "common/net/address.proto";
  9. enum DomainStrategy {
  10. AS_IS = 0;
  11. USE_IP = 1;
  12. USE_IP4 = 2;
  13. USE_IP6 = 3;
  14. USE_IP46 = 4;
  15. USE_IP64 = 5;
  16. FORCE_IP = 6;
  17. FORCE_IP4 = 7;
  18. FORCE_IP6 = 8;
  19. FORCE_IP46 = 9;
  20. FORCE_IP64 = 10;
  21. }
  22. enum AddressPortStrategy {
  23. None = 0;
  24. SrvPortOnly = 1;
  25. SrvAddressOnly = 2;
  26. SrvPortAndAddress = 3;
  27. TxtPortOnly = 4;
  28. TxtAddressOnly = 5;
  29. TxtPortAndAddress = 6;
  30. }
  31. message TransportConfig {
  32. // Transport protocol name.
  33. string protocol_name = 3;
  34. // Specific transport protocol settings.
  35. xray.common.serial.TypedMessage settings = 2;
  36. }
  37. message StreamConfig {
  38. xray.common.net.IPOrDomain address = 8;
  39. uint32 port = 9;
  40. // Effective network.
  41. string protocol_name = 5;
  42. repeated TransportConfig transport_settings = 2;
  43. // Type of security. Must be a message name of the settings proto.
  44. string security_type = 3;
  45. // Transport security settings. They can be either TLS or REALITY.
  46. repeated xray.common.serial.TypedMessage security_settings = 4;
  47. SocketConfig socket_settings = 6;
  48. }
  49. message ProxyConfig {
  50. string tag = 1;
  51. bool transportLayerProxy = 2;
  52. }
  53. message CustomSockopt {
  54. string system = 1;
  55. string network = 2;
  56. string level = 3;
  57. string opt = 4;
  58. string value = 5;
  59. string type = 6;
  60. }
  61. // SocketConfig is options to be applied on network sockets.
  62. message SocketConfig {
  63. // Mark of the connection. If non-zero, the value will be set to SO_MARK.
  64. int32 mark = 1;
  65. // TFO is the state of TFO settings.
  66. int32 tfo = 2;
  67. enum TProxyMode {
  68. // TProxy is off.
  69. Off = 0;
  70. // TProxy mode.
  71. TProxy = 1;
  72. // Redirect mode.
  73. Redirect = 2;
  74. }
  75. // TProxy is for enabling TProxy socket option.
  76. TProxyMode tproxy = 3;
  77. // ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket
  78. // option. This option is for UDP only.
  79. bool receive_original_dest_address = 4;
  80. bytes bind_address = 5;
  81. uint32 bind_port = 6;
  82. bool accept_proxy_protocol = 7;
  83. DomainStrategy domain_strategy = 8;
  84. string dialer_proxy = 9;
  85. int32 tcp_keep_alive_interval = 10;
  86. int32 tcp_keep_alive_idle = 11;
  87. string tcp_congestion = 12;
  88. string interface = 13;
  89. bool v6only = 14;
  90. int32 tcp_window_clamp = 15;
  91. int32 tcp_user_timeout = 16;
  92. int32 tcp_max_seg = 17;
  93. bool penetrate = 18;
  94. bool tcp_mptcp = 19;
  95. repeated CustomSockopt customSockopt = 20;
  96. AddressPortStrategy address_port_strategy = 21;
  97. HappyEyeballsConfig happy_eyeballs = 22;
  98. }
  99. message HappyEyeballsConfig {
  100. bool prioritize_ipv6 = 1;
  101. uint32 interleave = 2;
  102. uint64 try_delayMs = 3;
  103. uint32 max_concurrent_try = 4;
  104. }