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>2026-04-20 19:22:43 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2026-04-20 19:22:43 +0300
commit2b3b2770b49cd56097d7cebdf279e267a77072f6 (patch)
tree7ef2590b3aab2fa97970a6c27011caf1cbcd6235
parent094ea9faaae35b452ca3bd30b4b519da95ef984d (diff)
Sniffing: Add ipsExcluded, domainsExcluded (supports IP, CIDR, "geoip:", "ext:")
-rw-r--r--web/assets/js/model/inbound.js27
-rw-r--r--web/html/form/sniffing.html44
2 files changed, 55 insertions, 16 deletions
diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js
index c94bd8d3..d4df6d36 100644
--- a/web/assets/js/model/inbound.js
+++ b/web/assets/js/model/inbound.js
@@ -1252,28 +1252,43 @@ class Sniffing extends XrayCommonClass {
enabled = false,
destOverride = ['http', 'tls', 'quic', 'fakedns'],
metadataOnly = false,
- routeOnly = false) {
+ routeOnly = false,
+ ipsExcluded = [],
+ domainsExcluded = []) {
super();
this.enabled = enabled;
- this.destOverride = destOverride;
+ this.destOverride = Array.isArray(destOverride) && destOverride.length > 0 ? destOverride : ['http', 'tls', 'quic', 'fakedns'];
this.metadataOnly = metadataOnly;
this.routeOnly = routeOnly;
+ this.ipsExcluded = Array.isArray(ipsExcluded) ? ipsExcluded : [];
+ this.domainsExcluded = Array.isArray(domainsExcluded) ? domainsExcluded : [];
}
static fromJson(json = {}) {
let destOverride = ObjectUtil.clone(json.destOverride);
- if (!ObjectUtil.isEmpty(destOverride) && !ObjectUtil.isArrEmpty(destOverride)) {
- if (ObjectUtil.isEmpty(destOverride[0])) {
- destOverride = ['http', 'tls', 'quic', 'fakedns'];
- }
+ if (ObjectUtil.isEmpty(destOverride) || ObjectUtil.isArrEmpty(destOverride) || ObjectUtil.isEmpty(destOverride[0])) {
+ destOverride = ['http', 'tls', 'quic', 'fakedns'];
}
return new Sniffing(
!!json.enabled,
destOverride,
json.metadataOnly,
json.routeOnly,
+ json.ipsExcluded || [],
+ json.domainsExcluded || [],
);
}
+
+ toJson() {
+ return {
+ enabled: this.enabled,
+ destOverride: this.destOverride,
+ metadataOnly: this.metadataOnly,
+ routeOnly: this.routeOnly,
+ ipsExcluded: this.ipsExcluded.length > 0 ? this.ipsExcluded : undefined,
+ domainsExcluded: this.domainsExcluded.length > 0 ? this.domainsExcluded : undefined,
+ };
+ }
}
class Inbound extends XrayCommonClass {
diff --git a/web/html/form/sniffing.html b/web/html/form/sniffing.html
index d8a2e85a..f9cf6b9c 100644
--- a/web/html/form/sniffing.html
+++ b/web/html/form/sniffing.html
@@ -1,29 +1,53 @@
{{define "form/sniffing"}}
-<a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
+<a-form
+ :colon="false"
+ :label-col="{ md: {span:8} }"
+ :wrapper-col="{ md: {span:14} }"
+>
<a-form-item>
<span slot="label">
{{ i18n "enabled" }}
- <a-tooltip>
- <template slot="title">
- <span>{{ i18n "pages.inbounds.noRecommendKeepDefault" }}</span>
- </template>
- <a-icon type="question-circle"></a-icon>
- </a-tooltip>
+ <a-tooltip>
+ <template slot="title">
+ <span>{{ i18n "pages.inbounds.noRecommendKeepDefault" }}</span>
+ </template>
+ <a-icon type="question-circle"></a-icon>
+ </a-tooltip>
</span>
<a-switch v-model="inbound.sniffing.enabled"></a-switch>
</a-form-item>
<template v-if="inbound.sniffing.enabled">
<a-form-item :wrapper-col="{span:24}">
<a-checkbox-group v-model="inbound.sniffing.destOverride">
- <a-checkbox v-for="key,value in SNIFFING_OPTION" :value="key">[[ value ]]</a-checkbox>
+ <a-checkbox v-for="key,value in SNIFFING_OPTION" :value="key"
+ >[[ value ]]</a-checkbox
+ >
</a-checkbox-group>
</a-form-item>
- <a-form-item label='Metadata Only'>
+ <a-form-item label="Metadata Only">
<a-switch v-model="inbound.sniffing.metadataOnly"></a-switch>
</a-form-item>
- <a-form-item label='Route Only'>
+ <a-form-item label="Route Only">
<a-switch v-model="inbound.sniffing.routeOnly"></a-switch>
</a-form-item>
+ <a-form-item label="IPs Excluded">
+ <a-select
+ mode="tags"
+ v-model="inbound.sniffing.ipsExcluded"
+ :style="{ width: '100%' }"
+ :token-separators="[',']"
+ placeholder="IP/CIDR/geoip:*/ext:*"
+ ></a-select>
+ </a-form-item>
+ <a-form-item label="Domains Excluded">
+ <a-select
+ mode="tags"
+ v-model="inbound.sniffing.domainsExcluded"
+ :style="{ width: '100%' }"
+ :token-separators="[',']"
+ placeholder="domain:*/ext:*"
+ ></a-select>
+ </a-form-item>
</template>
</a-form>
{{end}}