config.proto 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. syntax = "proto3";
  2. package v2ray.core.transport.internet;
  3. option csharp_namespace = "V2Ray.Core.Transport.Internet";
  4. option go_package = "github.com/v2fly/v2ray-core/v4/transport/internet";
  5. option java_package = "com.v2ray.core.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. message TransportConfig {
  17. // Type of network that this settings supports.
  18. // Deprecated. Use the string form below.
  19. TransportProtocol protocol = 1 [ deprecated = true ];
  20. // Type of network that this settings supports.
  21. string protocol_name = 3;
  22. // Specific settings. Must be of the transports.
  23. v2ray.core.common.serial.TypedMessage settings = 2;
  24. }
  25. message StreamConfig {
  26. // Effective network. Deprecated. Use the string form below.
  27. TransportProtocol protocol = 1 [ deprecated = true ];
  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 v2ray.core.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. // SocketConfig is options to be applied on network sockets.
  42. message SocketConfig {
  43. // Mark of the connection. If non-zero, the value will be set to SO_MARK.
  44. int32 mark = 1;
  45. enum TCPFastOpenState {
  46. // AsIs is to leave the current TFO state as is, unmodified.
  47. AsIs = 0;
  48. // Enable is for enabling TFO explictly.
  49. Enable = 1;
  50. // Disable is for disabling TFO explictly.
  51. Disable = 2;
  52. }
  53. // TFO is the state of TFO settings.
  54. TCPFastOpenState tfo = 2;
  55. enum TProxyMode {
  56. // TProxy is off.
  57. Off = 0;
  58. // TProxy mode.
  59. TProxy = 1;
  60. // Redirect mode.
  61. Redirect = 2;
  62. }
  63. // TProxy is for enabling TProxy socket option.
  64. TProxyMode tproxy = 3;
  65. // ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket
  66. // option. This option is for UDP only.
  67. bool receive_original_dest_address = 4;
  68. bytes bind_address = 5;
  69. uint32 bind_port = 6;
  70. bool accept_proxy_protocol = 7;
  71. }