Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsanaei <ho3ein.sanaei@gmail.com>2024-05-24 10:57:14 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2024-05-24 10:57:14 +0300
commit80cd7931544443f2e423183227ef95741c6f0254 (patch)
treefa26b8becebac03cd9078e967ebee4c64b6cc244
parentd070a82b3d0149904a5d54ec3608c5789a6a265a (diff)
new - sockopt : all features #2293
-rw-r--r--web/assets/js/model/xray.js70
-rw-r--r--web/html/xui/form/stream/stream_sockopt.html48
2 files changed, 110 insertions, 8 deletions
diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js
index e43f7e10..73dcdb27 100644
--- a/web/assets/js/model/xray.js
+++ b/web/assets/js/model/xray.js
@@ -90,6 +90,25 @@ const USAGE_OPTION = {
ISSUE: "issue",
};
+const DOMAIN_STRATEGY_OPTION = {
+ AS_IS: "AsIs",
+ USE_IP: "UseIP",
+ USE_IPV6V4: "UseIPv6v4",
+ USE_IPV6: "UseIPv6",
+ USE_IPV4V6: "UseIPv4v6",
+ USE_IPV4: "UseIPv4",
+ FORCE_IP: "ForceIP",
+ FORCE_IPV6V4: "ForceIPv6v4",
+ FORCE_IPV6: "ForceIPv6",
+ FORCE_IPV4V6: "ForceIPv4v6",
+ FORCE_IPV4: "ForceIPv4",
+};
+const TCP_CONGESTION_OPTION = {
+ BBR: "bbr",
+ CUBIC: "cubic",
+ RENO: "reno",
+};
+
Object.freeze(Protocols);
Object.freeze(SSMethods);
Object.freeze(XTLS_FLOW_CONTROL);
@@ -100,6 +119,8 @@ Object.freeze(UTLS_FINGERPRINT);
Object.freeze(ALPN_OPTION);
Object.freeze(SNIFFING_OPTION);
Object.freeze(USAGE_OPTION);
+Object.freeze(DOMAIN_STRATEGY_OPTION);
+Object.freeze(TCP_CONGESTION_OPTION);
class XrayCommonClass {
@@ -881,7 +902,24 @@ RealityStreamSettings.Settings = class extends XrayCommonClass {
};
class SockoptStreamSettings extends XrayCommonClass {
- constructor(acceptProxyProtocol = false, tcpFastOpen = false, mark = 0, tproxy="off", tcpMptcp = false, tcpNoDelay = false) {
+ constructor(
+ acceptProxyProtocol = false,
+ tcpFastOpen = false,
+ mark = 0,
+ tproxy="off",
+ tcpMptcp = false,
+ tcpNoDelay = false,
+ domainStrategy = DOMAIN_STRATEGY_OPTION.USE_IP,
+ tcpMaxSeg = 1440,
+ dialerProxy = "",
+ tcpKeepAliveInterval = 0,
+ tcpKeepAliveIdle = 300,
+ tcpUserTimeout = 10000,
+ tcpcongestion = TCP_CONGESTION_OPTION.BBR,
+ V6Only = false,
+ tcpWindowClamp = 600,
+ interfaceName = "",
+ ) {
super();
this.acceptProxyProtocol = acceptProxyProtocol;
this.tcpFastOpen = tcpFastOpen;
@@ -889,6 +927,16 @@ class SockoptStreamSettings extends XrayCommonClass {
this.tproxy = tproxy;
this.tcpMptcp = tcpMptcp;
this.tcpNoDelay = tcpNoDelay;
+ this.domainStrategy = domainStrategy;
+ this.tcpMaxSeg = tcpMaxSeg;
+ this.dialerProxy = dialerProxy;
+ this.tcpKeepAliveInterval = tcpKeepAliveInterval;
+ this.tcpKeepAliveIdle = tcpKeepAliveIdle;
+ this.tcpUserTimeout = tcpUserTimeout;
+ this.tcpcongestion = tcpcongestion;
+ this.V6Only = V6Only;
+ this.tcpWindowClamp = tcpWindowClamp;
+ this.interfaceName = interfaceName;
}
static fromJson(json = {}) {
@@ -900,6 +948,16 @@ class SockoptStreamSettings extends XrayCommonClass {
json.tproxy,
json.tcpMptcp,
json.tcpNoDelay,
+ json.domainStrategy,
+ json.tcpMaxSeg,
+ json.dialerProxy,
+ json.tcpKeepAliveInterval,
+ json.tcpKeepAliveIdle,
+ json.tcpUserTimeout,
+ json.tcpcongestion,
+ json.V6Only,
+ json.tcpWindowClamp,
+ json.interface,
);
}
@@ -911,6 +969,16 @@ class SockoptStreamSettings extends XrayCommonClass {
tproxy: this.tproxy,
tcpMptcp: this.tcpMptcp,
tcpNoDelay: this.tcpNoDelay,
+ domainStrategy: this.domainStrategy,
+ tcpMaxSeg: this.tcpMaxSeg,
+ dialerProxy: this.dialerProxy,
+ tcpKeepAliveInterval: this.tcpKeepAliveInterval,
+ tcpKeepAliveIdle: this.tcpKeepAliveIdle,
+ tcpUserTimeout: this.tcpUserTimeout,
+ tcpcongestion: this.tcpcongestion,
+ V6Only: this.V6Only,
+ tcpWindowClamp: this.tcpWindowClamp,
+ interface: this.interfaceName,
};
}
}
diff --git a/web/html/xui/form/stream/stream_sockopt.html b/web/html/xui/form/stream/stream_sockopt.html
index 0a50a89e..a243a0d5 100644
--- a/web/html/xui/form/stream/stream_sockopt.html
+++ b/web/html/xui/form/stream/stream_sockopt.html
@@ -5,27 +5,61 @@
<a-switch v-model="inbound.stream.sockoptSwitch"></a-switch>
</a-form-item>
<template v-if="inbound.stream.sockoptSwitch">
+ <a-form-item label="Route Mark">
+ <a-input-number v-model="inbound.stream.sockopt.mark" :min="0"></a-input-number>
+ </a-form-item>
+ <a-form-item label="TCP Keep Alive Interval">
+ <a-input-number v-model="inbound.stream.sockopt.tcpKeepAliveInterval" :min="0"></a-input-number>
+ </a-form-item>
+ <a-form-item label="TCP Keep Alive Idle">
+ <a-input-number v-model="inbound.stream.sockopt.tcpKeepAliveIdle" :min="0"></a-input-number>
+ </a-form-item>
+ <a-form-item label="TCP Max Seg">
+ <a-input-number v-model="inbound.stream.sockopt.tcpMaxSeg" :min="0"></a-input-number>
+ </a-form-item>
+ <a-form-item label="TCP User Timeout">
+ <a-input-number v-model="inbound.stream.sockopt.tcpUserTimeout" :min="0"></a-input-number>
+ </a-form-item>
+ <a-form-item label="TCP Window Clamp">
+ <a-input-number v-model="inbound.stream.sockopt.tcpWindowClamp" :min="0"></a-input-number>
+ </a-form-item>
<a-form-item label="Proxy Protocol">
<a-switch v-model="inbound.stream.sockopt.acceptProxyProtocol"></a-switch>
</a-form-item>
<a-form-item label="TCP Fast Open">
<a-switch v-model.trim="inbound.stream.sockopt.tcpFastOpen"></a-switch>
</a-form-item>
- <a-form-item label="Route Mark">
- <a-input-number v-model="inbound.stream.sockopt.mark" :min="0"></a-input-number>
+ <a-form-item label="Multipath TCP">
+ <a-switch v-model.trim="inbound.stream.sockopt.tcpMptcp"></a-switch>
+ </a-form-item>
+ <a-form-item label="TCP No-Delay">
+ <a-switch v-model.trim="inbound.stream.sockopt.tcpNoDelay"></a-switch>
+ </a-form-item>
+ <a-form-item label="V6 Only">
+ <a-switch v-model.trim="inbound.stream.sockopt.V6Only"></a-switch>
+ </a-form-item>
+ <a-form-item label='Domain Strategy'>
+ <a-select v-model="inbound.stream.sockopt.domainStrategy" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
+ <a-select-option v-for="key in DOMAIN_STRATEGY_OPTION" :value="key">[[ key ]]</a-select-option>
+ </a-select>
+ </a-form-item>
+ <a-form-item label='TCP Congestion'>
+ <a-select v-model="inbound.stream.sockopt.tcpcongestion" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
+ <a-select-option v-for="key in TCP_CONGESTION_OPTION" :value="key">[[ key ]]</a-select-option>
+ </a-select>
</a-form-item>
<a-form-item label="TProxy">
- <a-select v-model="inbound.stream.sockopt.tproxy" :dropdown-class-name="themeSwitcher.currentTheme">
+ <a-select v-model="inbound.stream.sockopt.tproxy" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
<a-select-option value="off">Off</a-select-option>
<a-select-option value="redirect">Redirect</a-select-option>
<a-select-option value="tproxy">TProxy</a-select-option>
</a-select>
</a-form-item>
- <a-form-item label="Multipath TCP">
- <a-switch v-model.trim="inbound.stream.sockopt.tcpMptcp"></a-switch>
+ <a-form-item label="Dialer Proxy">
+ <a-input v-model="inbound.stream.sockopt.dialerProxy"></a-input>
</a-form-item>
- <a-form-item label="TCP No-Delay">
- <a-switch v-model.trim="inbound.stream.sockopt.tcpNoDelay"></a-switch>
+ <a-form-item label="Interface Name">
+ <a-input v-model="inbound.stream.sockopt.interfaceName"></a-input>
</a-form-item>
</template>
</a-form>