config.proto 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. }