config.proto 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. message TransportConfig {
  23. // Type of network that this settings supports.
  24. string protocol_name = 3;
  25. // Specific settings. Must be of the transports.
  26. xray.common.serial.TypedMessage settings = 2;
  27. }
  28. message StreamConfig {
  29. xray.common.net.IPOrDomain address = 8;
  30. uint32 port = 9;
  31. // Effective network.
  32. string protocol_name = 5;
  33. repeated TransportConfig transport_settings = 2;
  34. // Type of security. Must be a message name of the settings proto.
  35. string security_type = 3;
  36. // Settings for transport security. For now the only choice is TLS.
  37. repeated xray.common.serial.TypedMessage security_settings = 4;
  38. SocketConfig socket_settings = 6;
  39. }
  40. message ProxyConfig {
  41. string tag = 1;
  42. bool transportLayerProxy = 2;
  43. }
  44. message CustomSockopt {
  45. string level = 1;
  46. string opt = 2;
  47. string value = 3;
  48. string type = 4;
  49. }
  50. // SocketConfig is options to be applied on network sockets.
  51. message SocketConfig {
  52. // Mark of the connection. If non-zero, the value will be set to SO_MARK.
  53. int32 mark = 1;
  54. // TFO is the state of TFO settings.
  55. int32 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. DomainStrategy domain_strategy = 8;
  73. string dialer_proxy = 9;
  74. int32 tcp_keep_alive_interval = 10;
  75. int32 tcp_keep_alive_idle = 11;
  76. string tcp_congestion = 12;
  77. string interface = 13;
  78. bool v6only = 14;
  79. int32 tcp_window_clamp = 15;
  80. int32 tcp_user_timeout = 16;
  81. int32 tcp_max_seg = 17;
  82. bool tcp_no_delay = 18;
  83. bool tcp_mptcp = 19;
  84. repeated CustomSockopt customSockopt = 20;
  85. }