增加子网代理使用的判断

This commit is contained in:
黑先森
2024-12-19 17:23:28 +08:00
parent 0fde619516
commit 582a4ab819
+4 -2
View File
@@ -1099,13 +1099,15 @@
args.push("-l", config.port);
}
if (mainStore.cidrEnable && config.proxyNetworks) {
let formatProxyNetworks = config.proxyNetworks.split("\n");
let formatProxyNetworks = config.proxyNetworks.trim().split("\n");
const newformatProxyNetworks = formatProxyNetworks
.map(el => el.trim())
.filter(cidr => {
return /^\d+\.\d+\.\d+\.\d+\/\d+$/g.test(cidr);
});
args.push("--proxy-networks", ...newformatProxyNetworks);
if(newformatProxyNetworks.length > 0) {
args.push("--proxy-networks", ...newformatProxyNetworks);
}
config.proxyNetworks = formatProxyNetworks.join("\n");
}
if (config.disableEncryption) {