config.proto 2.4 KB

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