config.proto 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. enum TransportProtocol {
  9. TCP = 0;
  10. UDP = 1;
  11. MKCP = 2;
  12. WebSocket = 3;
  13. HTTP = 4;
  14. DomainSocket = 5;
  15. HTTPUpgrade = 6;
  16. SplitHTTP = 7;
  17. }
  18. enum DomainStrategy {
  19. AS_IS = 0;
  20. USE_IP = 1;
  21. USE_IP4 = 2;
  22. USE_IP6 = 3;
  23. USE_IP46 = 4;
  24. USE_IP64 = 5;
  25. FORCE_IP = 6;
  26. FORCE_IP4 = 7;
  27. FORCE_IP6 = 8;
  28. FORCE_IP46 = 9;
  29. FORCE_IP64 = 10;
  30. }
  31. message TransportConfig {
  32. // Type of network that this settings supports.
  33. // Deprecated. Use the string form below.
  34. TransportProtocol protocol = 1 [ deprecated = true ];
  35. // Type of network that this settings supports.
  36. string protocol_name = 3;
  37. // Specific settings. Must be of the transports.
  38. xray.common.serial.TypedMessage settings = 2;
  39. }
  40. message StreamConfig {
  41. // Effective network. Deprecated. Use the string form below.
  42. TransportProtocol protocol = 1 [ deprecated = true ];
  43. // Effective network.
  44. string protocol_name = 5;
  45. repeated TransportConfig transport_settings = 2;
  46. // Type of security. Must be a message name of the settings proto.
  47. string security_type = 3;
  48. // Settings for transport security. For now the only choice is TLS.
  49. repeated xray.common.serial.TypedMessage security_settings = 4;
  50. SocketConfig socket_settings = 6;
  51. }
  52. message ProxyConfig {
  53. string tag = 1;
  54. bool transportLayerProxy = 2;
  55. }
  56. message CustomSockopt {
  57. string level = 1;
  58. string opt = 2;
  59. string value = 3;
  60. string type = 4;
  61. }
  62. // SocketConfig is options to be applied on network sockets.
  63. message SocketConfig {
  64. // Mark of the connection. If non-zero, the value will be set to SO_MARK.
  65. int32 mark = 1;
  66. // TFO is the state of TFO settings.
  67. int32 tfo = 2;
  68. enum TProxyMode {
  69. // TProxy is off.
  70. Off = 0;
  71. // TProxy mode.
  72. TProxy = 1;
  73. // Redirect mode.
  74. Redirect = 2;
  75. }
  76. // TProxy is for enabling TProxy socket option.
  77. TProxyMode tproxy = 3;
  78. // ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket
  79. // option. This option is for UDP only.
  80. bool receive_original_dest_address = 4;
  81. bytes bind_address = 5;
  82. uint32 bind_port = 6;
  83. bool accept_proxy_protocol = 7;
  84. DomainStrategy domain_strategy = 8;
  85. string dialer_proxy = 9;
  86. int32 tcp_keep_alive_interval = 10;
  87. int32 tcp_keep_alive_idle = 11;
  88. string tcp_congestion = 12;
  89. string interface = 13;
  90. bool v6only = 14;
  91. int32 tcp_window_clamp = 15;
  92. int32 tcp_user_timeout = 16;
  93. int32 tcp_max_seg = 17;
  94. bool tcp_no_delay = 18;
  95. bool tcp_mptcp = 19;
  96. repeated CustomSockopt customSockopt = 20;
  97. }