mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-09 16:43:03 +00:00
340234166b
* Add TCP keep alive idle setting * Add TCP keep alive idle setting: auto generated * Add TCP keep alive support in Linux * Add TCP keep alive support in MacOS, FreeBSD * Add TCP keep alive support in Windows * fix bug introduced in adding tcp keep alive adjustment * embed macOS const to avoid platform inconsistency * embed macOS const to avoid platform inconsistency(again) * add TCP Keep Alive support in config * use sys/unix instead of syscall Suggestion from: https://github.com/v2fly/v2ray-core/pull/1395#issuecomment-974761647 * use sys/unix instead of syscall Suggestion from: https://github.com/v2fly/v2ray-core/pull/1395#issuecomment-974761647 * Separate TcpKeepAliveIdle and TcpKeepAliveInterval check logic * Disable tcp keepAlive when TcpKeepAliveIdle < 0 and TcpKeepAliveInterval <= 0 Co-authored-by: xqzr <34030394+xqzr@users.noreply.github.com> Co-authored-by: ValdikSS <iam@valdikss.org.ru> Co-authored-by: Shelikhoo <xiaokangwang@outlook.com> Co-authored-by: xqzr <34030394+xqzr@users.noreply.github.com>
100 lines
2.2 KiB
Protocol Buffer
100 lines
2.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package xray.transport.internet;
|
|
option csharp_namespace = "Xray.Transport.Internet";
|
|
option go_package = "github.com/xtls/xray-core/transport/internet";
|
|
option java_package = "com.xray.transport.internet";
|
|
option java_multiple_files = true;
|
|
|
|
import "common/serial/typed_message.proto";
|
|
|
|
enum TransportProtocol {
|
|
TCP = 0;
|
|
UDP = 1;
|
|
MKCP = 2;
|
|
WebSocket = 3;
|
|
HTTP = 4;
|
|
DomainSocket = 5;
|
|
}
|
|
|
|
enum DomainStrategy {
|
|
AS_IS = 0;
|
|
USE_IP = 1;
|
|
USE_IP4 = 2;
|
|
USE_IP6 = 3;
|
|
}
|
|
|
|
message TransportConfig {
|
|
// Type of network that this settings supports.
|
|
// Deprecated. Use the string form below.
|
|
TransportProtocol protocol = 1 [ deprecated = true ];
|
|
|
|
// Type of network that this settings supports.
|
|
string protocol_name = 3;
|
|
|
|
// Specific settings. Must be of the transports.
|
|
xray.common.serial.TypedMessage settings = 2;
|
|
}
|
|
|
|
message StreamConfig {
|
|
// Effective network. Deprecated. Use the string form below.
|
|
TransportProtocol protocol = 1 [ deprecated = true ];
|
|
|
|
// Effective network.
|
|
string protocol_name = 5;
|
|
|
|
repeated TransportConfig transport_settings = 2;
|
|
|
|
// Type of security. Must be a message name of the settings proto.
|
|
string security_type = 3;
|
|
|
|
// Settings for transport security. For now the only choice is TLS.
|
|
repeated xray.common.serial.TypedMessage security_settings = 4;
|
|
|
|
SocketConfig socket_settings = 6;
|
|
}
|
|
|
|
message ProxyConfig {
|
|
string tag = 1;
|
|
bool transportLayerProxy = 2;
|
|
}
|
|
|
|
// SocketConfig is options to be applied on network sockets.
|
|
message SocketConfig {
|
|
// Mark of the connection. If non-zero, the value will be set to SO_MARK.
|
|
int32 mark = 1;
|
|
|
|
// TFO is the state of TFO settings.
|
|
int32 tfo = 2;
|
|
|
|
enum TProxyMode {
|
|
// TProxy is off.
|
|
Off = 0;
|
|
// TProxy mode.
|
|
TProxy = 1;
|
|
// Redirect mode.
|
|
Redirect = 2;
|
|
}
|
|
|
|
// TProxy is for enabling TProxy socket option.
|
|
TProxyMode tproxy = 3;
|
|
|
|
// ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket
|
|
// option. This option is for UDP only.
|
|
bool receive_original_dest_address = 4;
|
|
|
|
bytes bind_address = 5;
|
|
|
|
uint32 bind_port = 6;
|
|
|
|
bool accept_proxy_protocol = 7;
|
|
|
|
DomainStrategy domain_strategy = 8;
|
|
|
|
string dialer_proxy = 9;
|
|
|
|
int32 tcp_keep_alive_interval = 10;
|
|
|
|
int32 tcp_keep_alive_idle = 11;
|
|
}
|