diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-05-22 19:35:46 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-05-22 21:06:49 +0300 |
| commit | 275370e32cddff5905cdf09ab9a60aa6799486e3 (patch) | |
| tree | a068648e6c496fbfc6e465857dc0a744da746617 | |
| parent | e7c59adc5928d9d9ef96480297f7618e3d57837c (diff) | |
new - (Sockopt) tcpMptcp , tcpNoDelay
https://xtls.github.io/en/config/transport.html#sockoptobject
| -rw-r--r-- | sub/subJsonService.go | 2 | ||||
| -rw-r--r-- | web/assets/js/model/outbound.js | 5 | ||||
| -rw-r--r-- | web/assets/js/model/xray.js | 8 | ||||
| -rw-r--r-- | web/html/xui/form/outbound.html | 3 | ||||
| -rw-r--r-- | web/html/xui/form/stream/stream_httpupgrade.html | 2 | ||||
| -rw-r--r-- | web/html/xui/form/stream/stream_sockopt.html | 14 | ||||
| -rw-r--r-- | web/html/xui/form/stream/stream_tcp.html | 2 | ||||
| -rw-r--r-- | web/html/xui/form/stream/stream_ws.html | 2 | ||||
| -rw-r--r-- | web/html/xui/settings.html | 1 |
9 files changed, 29 insertions, 10 deletions
diff --git a/sub/subJsonService.go b/sub/subJsonService.go index 057c1e81..76d0b126 100644 --- a/sub/subJsonService.go +++ b/sub/subJsonService.go @@ -211,7 +211,7 @@ func (s *SubJsonService) streamData(stream string) map[string]interface{} { delete(streamSettings, "sockopt") if s.fragment != "" { - streamSettings["sockopt"] = json_util.RawMessage(`{"dialerProxy": "fragment", "tcpKeepAliveIdle": 100, "tcpNoDelay": true}`) + streamSettings["sockopt"] = json_util.RawMessage(`{"dialerProxy": "fragment", "tcpKeepAliveIdle": 100, "tcpMptcp": true, "tcpNoDelay": true}`) } // remove proxy protocol diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index 1cb1df21..e8f846b4 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -361,11 +361,12 @@ class RealityStreamSettings extends CommonClass { } }; class SockoptStreamSettings extends CommonClass { - constructor(dialerProxy = "", tcpFastOpen = false, tcpKeepAliveInterval = 0, tcpNoDelay = false) { + constructor(dialerProxy = "", tcpFastOpen = false, tcpKeepAliveInterval = 0, tcpMptcp = false, tcpNoDelay = false) { super(); this.dialerProxy = dialerProxy; this.tcpFastOpen = tcpFastOpen; this.tcpKeepAliveInterval = tcpKeepAliveInterval; + this.tcpMptcp = tcpMptcp; this.tcpNoDelay = tcpNoDelay; } @@ -375,6 +376,7 @@ class SockoptStreamSettings extends CommonClass { json.dialerProxy, json.tcpFastOpen, json.tcpKeepAliveInterval, + json.tcpMptcp, json.tcpNoDelay, ); } @@ -384,6 +386,7 @@ class SockoptStreamSettings extends CommonClass { dialerProxy: this.dialerProxy, tcpFastOpen: this.tcpFastOpen, tcpKeepAliveInterval: this.tcpKeepAliveInterval, + tcpMptcp: this.tcpMptcp, tcpNoDelay: this.tcpNoDelay, }; } diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index b8e85ff6..e43f7e10 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -881,12 +881,14 @@ RealityStreamSettings.Settings = class extends XrayCommonClass { }; class SockoptStreamSettings extends XrayCommonClass { - constructor(acceptProxyProtocol = false, tcpFastOpen = false, mark = 0, tproxy="off") { + constructor(acceptProxyProtocol = false, tcpFastOpen = false, mark = 0, tproxy="off", tcpMptcp = false, tcpNoDelay = false) { super(); this.acceptProxyProtocol = acceptProxyProtocol; this.tcpFastOpen = tcpFastOpen; this.mark = mark; this.tproxy = tproxy; + this.tcpMptcp = tcpMptcp; + this.tcpNoDelay = tcpNoDelay; } static fromJson(json = {}) { @@ -896,6 +898,8 @@ class SockoptStreamSettings extends XrayCommonClass { json.tcpFastOpen, json.mark, json.tproxy, + json.tcpMptcp, + json.tcpNoDelay, ); } @@ -905,6 +909,8 @@ class SockoptStreamSettings extends XrayCommonClass { tcpFastOpen: this.tcpFastOpen, mark: this.mark, tproxy: this.tproxy, + tcpMptcp: this.tcpMptcp, + tcpNoDelay: this.tcpNoDelay, }; } } diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index af432fdf..0718d4ed 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -403,6 +403,9 @@ <a-form-item label="Keep Alive Interval"> <a-input-number v-model="outbound.stream.sockopt.tcpKeepAliveInterval" :min="0"></a-input-number> </a-form-item> + <a-form-item label="Multipath TCP"> + <a-switch v-model.trim="outbound.stream.sockopt.tcpMptcp"></a-switch> + </a-form-item> <a-form-item label="TCP No-Delay"> <a-switch v-model="outbound.stream.sockopt.tcpNoDelay"></a-switch> </a-form-item> diff --git a/web/html/xui/form/stream/stream_httpupgrade.html b/web/html/xui/form/stream/stream_httpupgrade.html index d1cd2e02..a98291cb 100644 --- a/web/html/xui/form/stream/stream_httpupgrade.html +++ b/web/html/xui/form/stream/stream_httpupgrade.html @@ -1,6 +1,6 @@ {{define "form/streamHTTPUpgrade"}} <a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }"> - <a-form-item label="PROXY Protocol"> + <a-form-item label="Proxy Protocol"> <a-switch v-model="inbound.stream.httpupgrade.acceptProxyProtocol"></a-switch> </a-form-item> <a-form-item label='{{ i18n "host" }}'> diff --git a/web/html/xui/form/stream/stream_sockopt.html b/web/html/xui/form/stream/stream_sockopt.html index dd60a7e1..0a50a89e 100644 --- a/web/html/xui/form/stream/stream_sockopt.html +++ b/web/html/xui/form/stream/stream_sockopt.html @@ -1,11 +1,11 @@ {{define "form/streamSockopt"}} <a-divider style="margin:5px 0 0;"></a-divider> <a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }"> - <a-form-item label="TPROXY"> + <a-form-item label="Sockopt"> <a-switch v-model="inbound.stream.sockoptSwitch"></a-switch> </a-form-item> <template v-if="inbound.stream.sockoptSwitch"> - <a-form-item label="PROXY Protocol"> + <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"> @@ -14,13 +14,19 @@ <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="TPROXY"> + <a-form-item label="TProxy"> <a-select v-model="inbound.stream.sockopt.tproxy" :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-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> + <a-form-item label="TCP No-Delay"> + <a-switch v-model.trim="inbound.stream.sockopt.tcpNoDelay"></a-switch> + </a-form-item> </template> </a-form> {{end}} diff --git a/web/html/xui/form/stream/stream_tcp.html b/web/html/xui/form/stream/stream_tcp.html index cf1a03ca..31d2f9e8 100644 --- a/web/html/xui/form/stream/stream_tcp.html +++ b/web/html/xui/form/stream/stream_tcp.html @@ -1,7 +1,7 @@ {{define "form/streamTCP"}} <!-- tcp type --> <a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }"> - <a-form-item label="PROXY Protocol" v-if="inbound.canEnableTls()"> + <a-form-item label="Proxy Protocol" v-if="inbound.canEnableTls()"> <a-switch v-model="inbound.stream.tcp.acceptProxyProtocol"></a-switch> </a-form-item> <a-form-item label='HTTP {{ i18n "camouflage" }}'> diff --git a/web/html/xui/form/stream/stream_ws.html b/web/html/xui/form/stream/stream_ws.html index 9b71070c..80f44c50 100644 --- a/web/html/xui/form/stream/stream_ws.html +++ b/web/html/xui/form/stream/stream_ws.html @@ -1,6 +1,6 @@ {{define "form/streamWS"}} <a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }"> - <a-form-item label="PROXY Protocol"> + <a-form-item label="Proxy Protocol"> <a-switch v-model="inbound.stream.ws.acceptProxyProtocol"></a-switch> </a-form-item> <a-form-item label='{{ i18n "host" }}'> diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 8bcb0258..96293daf 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -407,6 +407,7 @@ streamSettings: { sockopt: { tcpKeepAliveIdle: 100, + tcpMptcp: true, tcpNoDelay: true } } |
