config.proto 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 DomainStrategy {
  9. AS_IS = 0;
  10. USE_IP = 1;
  11. USE_IP4 = 2;
  12. USE_IP6 = 3;
  13. USE_IP46 = 4;
  14. USE_IP64 = 5;
  15. FORCE_IP = 6;
  16. FORCE_IP4 = 7;
  17. FORCE_IP6 = 8;
  18. FORCE_IP46 = 9;
  19. FORCE_IP64 = 10;
  20. }
  21. message TransportConfig {
  22. // Type of network that this settings supports.
  23. string protocol_name = 3;
  24. // Specific settings. Must be of the transports.
  25. xray.common.serial.TypedMessage settings = 2;
  26. }
  27. message StreamConfig {
  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 xray.common.serial.TypedMessage security_settings = 4;
  35. SocketConfig socket_settings = 6;
  36. }
  37. message ProxyConfig {
  38. string tag = 1;
  39. bool transportLayerProxy = 2;
  40. }
  41. message CustomSockopt {
  42. string level = 1;
  43. string opt = 2;
  44. string value = 3;
  45. string type = 4;
  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. int32 tcp_max_seg = 17;
  79. bool tcp_no_delay = 18;
  80. bool tcp_mptcp = 19;
  81. repeated CustomSockopt customSockopt = 20;
  82. }