Compare commits

..

No commits in common. "b4a1d814449e40b87f3b41415fcf8b6aee71e6be" and "51220917c4ef60c5ff886925792c8323f46cf5f2" have entirely different histories.

4 changed files with 47 additions and 65 deletions

View file

@ -554,7 +554,6 @@ class TlsStreamSettings extends XrayCommonClass {
maxVersion = TLS_VERSION_OPTION.TLS13, maxVersion = TLS_VERSION_OPTION.TLS13,
cipherSuites = '', cipherSuites = '',
rejectUnknownSni = false, rejectUnknownSni = false,
serverNameToVerify = 'dns.google',
disableSystemRoot = false, disableSystemRoot = false,
enableSessionResumption = false, enableSessionResumption = false,
certificates = [new TlsStreamSettings.Cert()], certificates = [new TlsStreamSettings.Cert()],
@ -567,7 +566,6 @@ class TlsStreamSettings extends XrayCommonClass {
this.maxVersion = maxVersion; this.maxVersion = maxVersion;
this.cipherSuites = cipherSuites; this.cipherSuites = cipherSuites;
this.rejectUnknownSni = rejectUnknownSni; this.rejectUnknownSni = rejectUnknownSni;
this.serverNameToVerify = serverNameToVerify;
this.disableSystemRoot = disableSystemRoot; this.disableSystemRoot = disableSystemRoot;
this.enableSessionResumption = enableSessionResumption; this.enableSessionResumption = enableSessionResumption;
this.certs = certificates; this.certs = certificates;
@ -599,7 +597,6 @@ class TlsStreamSettings extends XrayCommonClass {
json.maxVersion, json.maxVersion,
json.cipherSuites, json.cipherSuites,
json.rejectUnknownSni, json.rejectUnknownSni,
json.serverNameToVerify,
json.disableSystemRoot, json.disableSystemRoot,
json.enableSessionResumption, json.enableSessionResumption,
certs, certs,
@ -615,7 +612,6 @@ class TlsStreamSettings extends XrayCommonClass {
maxVersion: this.maxVersion, maxVersion: this.maxVersion,
cipherSuites: this.cipherSuites, cipherSuites: this.cipherSuites,
rejectUnknownSni: this.rejectUnknownSni, rejectUnknownSni: this.rejectUnknownSni,
serverNameToVerify: this.serverNameToVerify,
disableSystemRoot: this.disableSystemRoot, disableSystemRoot: this.disableSystemRoot,
enableSessionResumption: this.enableSessionResumption, enableSessionResumption: this.enableSessionResumption,
certificates: TlsStreamSettings.toJsonArray(this.certs), certificates: TlsStreamSettings.toJsonArray(this.certs),

View file

@ -33,7 +33,7 @@
<a-form-item label="Max Upload Size (Byte)" v-if="inbound.stream.xhttp.mode === 'packet-up'"> <a-form-item label="Max Upload Size (Byte)" v-if="inbound.stream.xhttp.mode === 'packet-up'">
<a-input v-model.trim="inbound.stream.xhttp.scMaxEachPostBytes"></a-input> <a-input v-model.trim="inbound.stream.xhttp.scMaxEachPostBytes"></a-input>
</a-form-item> </a-form-item>
<a-form-item label="Stream-Up Server" v-if="inbound.stream.xhttp.mode === 'stream-up'"> <a-form-item label="Stream-Up Server">
<a-input v-model.trim="inbound.stream.xhttp.scStreamUpServerSecs"></a-input> <a-input v-model.trim="inbound.stream.xhttp.scStreamUpServerSecs"></a-input>
</a-form-item> </a-form-item>
<a-form-item label="Padding Bytes"> <a-form-item label="Padding Bytes">

View file

@ -57,9 +57,6 @@
<a-form-item label="Session Resumption"> <a-form-item label="Session Resumption">
<a-switch v-model="inbound.stream.tls.enableSessionResumption"></a-switch> <a-switch v-model="inbound.stream.tls.enableSessionResumption"></a-switch>
</a-form-item> </a-form-item>
<a-form-item label="Server Name To Verify">
<a-input v-model.trim="inbound.stream.tls.serverNameToVerify"></a-input>
</a-form-item>
<template v-for="cert,index in inbound.stream.tls.certs"> <template v-for="cert,index in inbound.stream.tls.certs">
<a-form-item label='{{ i18n "certificate" }}'> <a-form-item label='{{ i18n "certificate" }}'>
<a-radio-group v-model="cert.useFile" button-style="solid"> <a-radio-group v-model="cert.useFile" button-style="solid">

View file

@ -382,40 +382,14 @@
</a-col> </a-col>
</a-row> </a-row>
<a-collapse v-if="enableDirect" style="margin-top: 14px;"> <a-collapse v-if="enableDirect" style="margin-top: 14px;">
<a-collapse-panel header='{{ i18n "pages.settings.direct"}}'> <a-collapse-panel header='{{ i18n "pages.xray.directips"}}'>
<a-list-item> <a-list-item style="padding: 10px 20px">
<a-row style="padding: 0 20px"> <a-checkbox-group v-model="directIPs" :options="IPsOptions"></a-checkbox-group>
<a-col :lg="24" :xl="12">
<a-list-item-meta
title='{{ i18n "pages.xray.directips" }}'/>
</a-col>
<a-col :lg="24" :xl="12">
<a-select mode="tags" style="width: 100%"
v-model="directIPs"
:dropdown-class-name="themeSwitcher.currentTheme">
<a-select-option :value="p.value" :label="p.label"
v-for="p in directIPsOptions"> [[ p.label ]]
</a-select-option>
</a-select>
</a-col>
</a-row>
</a-list-item> </a-list-item>
<a-list-item> </a-collapse-panel>
<a-row style="padding: 0 20px"> <a-collapse-panel header='{{ i18n "pages.xray.directdomains"}}'>
<a-col :lg="24" :xl="12"> <a-list-item style="padding: 10px 20px">
<a-list-item-meta <a-checkbox-group v-model="directDomains" :options="DomainsOptions"></a-checkbox-group>
title='{{ i18n "pages.xray.directdomains" }}'/>
</a-col>
<a-col :lg="24" :xl="12">
<a-select mode="tags" style="width: 100%"
v-model="directDomains"
:dropdown-class-name="themeSwitcher.currentTheme">
<a-select-option :value="p.value" :label="p.label"
v-for="p in diretDomainsOptions"> [[ p.label ]]
</a-select-option>
</a-select>
</a-col>
</a-row>
</a-list-item> </a-list-item>
</a-collapse-panel> </a-collapse-panel>
</a-collapse> </a-collapse>
@ -503,26 +477,25 @@
] ]
}, },
], ],
directIPsOptions: [ IPsOptions: [
{ label: 'Private IP', value: 'geoip:private' }, { label: 'Private IP', value: 'private' },
{ label: '🇮🇷 Iran', value: 'geoip:ir' }, { label: '🇮🇷 Iran', value: 'ir' },
{ label: '🇨🇳 China', value: 'geoip:cn' }, { label: '🇨🇳 China', value: 'cn' },
{ label: '🇷🇺 Russia', value: 'geoip:ru' }, { label: '🇷🇺 Russia', value: 'ru' },
{ label: '🇻🇳 Vietnam', value: 'geoip:vn' }, { label: '🇻🇳 Vietnam', value: 'vn' },
{ label: '🇪🇸 Spain', value: 'geoip:es' }, { label: '🇪🇸 Spain', value: 'es' },
{ label: '🇮🇩 Indonesia', value: 'geoip:id' }, { label: '🇮🇩 Indonesia', value: 'id' },
{ label: '🇺🇦 Ukraine', value: 'geoip:ua' }, { label: '🇺🇦 Ukraine', value: 'ua' },
{ label: '🇹🇷 Türkiye', value: 'geoip:tr' }, { label: '🇹🇷 Türkiye', value: 'tr' },
{ label: '🇧🇷 Brazil', value: 'geoip:br' }, { label: '🇧🇷 Brazil', value: 'br' },
], ],
diretDomainsOptions: [ DomainsOptions: [
{ label: 'Private DNS', value: 'geosite:private' }, { label: '🇮🇷 Iran', value: 'ir' },
{ label: '🇮🇷 Iran', value: 'geosite:category-ir' }, { label: '🇨🇳 China', value: 'cn' },
{ label: '🇨🇳 China', value: 'geosite:cn' }, { label: '🇷🇺 Russia', value: 'ru' },
{ label: '🇷🇺 Russia', value: 'geosite:category-ru' }, { label: 'Apple', value: 'apple' },
{ label: 'Apple', value: 'geosite:apple' }, { label: 'Meta', value: 'meta' },
{ label: 'Meta', value: 'geosite:meta' }, { label: 'Google', value: 'google' },
{ label: 'Google', value: 'geosite:google' },
], ],
get remarkModel() { get remarkModel() {
rm = this.allSetting.remarkModel; rm = this.allSetting.remarkModel;
@ -780,7 +753,7 @@
const rules = JSON.parse(this.allSetting.subJsonRules); const rules = JSON.parse(this.allSetting.subJsonRules);
if (!Array.isArray(rules)) return []; if (!Array.isArray(rules)) return [];
const ipRule = rules.find(r => r.ip); const ipRule = rules.find(r => r.ip);
return ipRule?.ip ?? []; return ipRule?.ip.map(d => d.replace("geoip:", "")) ?? [];
}, },
set: function (v) { set: function (v) {
let rules = JSON.parse(this.allSetting.subJsonRules); let rules = JSON.parse(this.allSetting.subJsonRules);
@ -794,7 +767,7 @@
rules[ruleIndex].ip = []; rules[ruleIndex].ip = [];
v.forEach(d => { v.forEach(d => {
rules[ruleIndex].ip.push(d); rules[ruleIndex].ip.push("geoip:" + d);
}); });
} }
this.allSetting.subJsonRules = JSON.stringify(rules); this.allSetting.subJsonRules = JSON.stringify(rules);
@ -806,18 +779,34 @@
const rules = JSON.parse(this.allSetting.subJsonRules); const rules = JSON.parse(this.allSetting.subJsonRules);
if (!Array.isArray(rules)) return []; if (!Array.isArray(rules)) return [];
const domainRule = rules.find(r => r.domain); const domainRule = rules.find(r => r.domain);
return domainRule?.domain ?? []; return domainRule?.domain.map(d => {
if (d.startsWith("geosite:category-")) {
return d.replace("geosite:category-", "");
}
return d.replace("geosite:", "");
})
?? [];
}, },
set: function (v) { set: function (v) {
let rules = JSON.parse(this.allSetting.subJsonRules); let rules = JSON.parse(this.allSetting.subJsonRules);
if (!Array.isArray(rules)) return; if (!Array.isArray(rules)) return;
if (v.length == 0) { if (v.length == 0) {
rules = rules.filter(r => !r.domain); rules = rules.filter(r => !r.domain);
} else { } else {
let ruleIndex = rules.findIndex(r => r.domain); let ruleIndex = rules.findIndex(r => r.domain);
if (ruleIndex == -1) ruleIndex = rules.push(this.defaultRules[0]) - 1; if (ruleIndex == -1) ruleIndex = rules.push(this.defaultRules[0]) - 1;
rules[ruleIndex].domain = v; rules[ruleIndex].domain = [];
v.forEach(d => {
let category = '';
if (["cn", "apple", "meta", "google"].includes(d)) {
category = "";
} else if (["ru", "ir"].includes(d)) {
category = "category-";
}
rules[ruleIndex].domain.push("geosite:" + category + d);
});
} }
this.allSetting.subJsonRules = JSON.stringify(rules); this.allSetting.subJsonRules = JSON.stringify(rules);
} }
@ -850,4 +839,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>