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>2025-03-05 15:14:17 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2025-03-05 15:14:17 +0300
commitf0cfd48f664d822fb42698d28d68657e7c28d50e (patch)
treebabe99163ae1a9d203ba754a58d5331640b2ca05
parentf5aea03765dcf613db75cc9141b9a5eac32d1ff0 (diff)
Sockopt: Add addressPortStrategy
-rw-r--r--web/assets/js/model/outbound.js18
-rw-r--r--web/html/xui/form/outbound.html9
2 files changed, 23 insertions, 4 deletions
diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js
index 8944157b..0103b1e8 100644
--- a/web/assets/js/model/outbound.js
+++ b/web/assets/js/model/outbound.js
@@ -86,6 +86,16 @@ const MODE_OPTION = {
STREAM_ONE: "stream-one",
};
+const Address_Port_Strategy = {
+ NONE: "none",
+ SrvPortOnly: "srvportonly",
+ SrvAddressOnly: "srvaddressonly",
+ SrvPortAndAddress: "srvportandaddress",
+ TxtPortOnly: "txtportonly",
+ TxtAddressOnly: "txtaddressonly",
+ TxtPortAndAddress: "txtportandaddress"
+};
+
Object.freeze(Protocols);
Object.freeze(SSMethods);
Object.freeze(TLS_FLOW_CONTROL);
@@ -95,7 +105,7 @@ Object.freeze(OutboundDomainStrategies);
Object.freeze(WireguardDomainStrategy);
Object.freeze(USERS_SECURITY);
Object.freeze(MODE_OPTION);
-
+Object.freeze(Address_Port_Strategy);
class CommonClass {
@@ -412,7 +422,8 @@ class SockoptStreamSettings extends CommonClass {
tcpFastOpen = false,
tcpKeepAliveInterval = 0,
tcpMptcp = false,
- penetrate = false
+ penetrate = false,
+ addressPortStrategy = Address_Port_Strategy.NONE,
) {
super();
this.dialerProxy = dialerProxy;
@@ -420,6 +431,7 @@ class SockoptStreamSettings extends CommonClass {
this.tcpKeepAliveInterval = tcpKeepAliveInterval;
this.tcpMptcp = tcpMptcp;
this.penetrate = penetrate;
+ this.addressPortStrategy = addressPortStrategy;
}
static fromJson(json = {}) {
@@ -430,6 +442,7 @@ class SockoptStreamSettings extends CommonClass {
json.tcpKeepAliveInterval,
json.tcpMptcp,
json.penetrate,
+ json.addressPortStrategy
);
}
@@ -440,6 +453,7 @@ class SockoptStreamSettings extends CommonClass {
tcpKeepAliveInterval: this.tcpKeepAliveInterval,
tcpMptcp: this.tcpMptcp,
penetrate: this.penetrate,
+ addressPortStrategy: this.addressPortStrategy
};
}
}
diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html
index 8abef4aa..1cea3ce7 100644
--- a/web/html/xui/form/outbound.html
+++ b/web/html/xui/form/outbound.html
@@ -465,12 +465,17 @@
<a-select-option v-for="tag in ['', ...outModal.tags]" :value="tag">[[ tag ]]</a-select-option>
</a-select>
</a-form-item>
- <a-form-item label="TCP Fast Open">
- <a-switch v-model="outbound.stream.sockopt.tcpFastOpen"></a-switch>
+ <a-form-item label='Address Port Strategy'>
+ <a-select v-model="outbound.stream.sockopt.addressPortStrategy" :dropdown-class-name="themeSwitcher.currentTheme">
+ <a-select-option v-for="key in Address_Port_Strategy" :value="key">[[ key ]]</a-select-option>
+ </a-select>
</a-form-item>
<a-form-item label="Keep Alive Interval">
<a-input-number v-model.number="outbound.stream.sockopt.tcpKeepAliveInterval" :min="0"></a-input-number>
</a-form-item>
+ <a-form-item label="TCP Fast Open">
+ <a-switch v-model="outbound.stream.sockopt.tcpFastOpen"></a-switch>
+ </a-form-item>
<a-form-item label="Multipath TCP">
<a-switch v-model.trim="outbound.stream.sockopt.tcpMptcp"></a-switch>
</a-form-item>