Update _worker.js

This commit is contained in:
CMLiussss
2024-06-22 02:26:51 +08:00
committed by GitHub
parent e2780348ea
commit e6264842fc

View File

@@ -9,7 +9,7 @@ let userID = '90cd4a77-141a-43c9-991b-08263cfe9c10';
let proxyIP = '';// 小白勿动该地址并不影响你的网速这是给CF代理使用的。'cdn.xn--b6gac.eu.org, cdn-all.xn--b6gac.eu.org, workers.cloudflare.cyou'
let sub = '';// 留空则使用内置订阅
let subconverter = 'url.v1.mk';// clash订阅转换后端目前使用肥羊的订阅转换功能。自带虚假uuid和host订阅。
let subconverter = 'subapi-loadbalancing.pages.dev';// clash订阅转换后端目前使用CM的订阅转换功能。自带虚假uuid和host订阅。
let subconfig = "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online.ini"; //订阅配置文件
// The user name and password do not contain special characters
@@ -1235,11 +1235,11 @@ async function getVLESSConfig(userID, hostName, sub, UA, RproxyIP, _url) {
if (!proxyIP || proxyIP =='') {
订阅器 = '您的订阅内容由 内置 addresses/ADD 参数提供, 当前使用的ProxyIP为空, 推荐您设置 proxyIP/PROXYIP ';
} else {
订阅器 = `您的订阅内容由 内置 addresses/ADD 参数提供, 当前使用的ProxyIP ${proxyIPs.join(',')}`;
订阅器 = `您的订阅内容由 内置 addresses/ADD 参数提供, 当前使用的ProxyIP: ${proxyIPs.join(', ')}`;
}
} else if (RproxyIP != 'true'){
if (enableSocks) 订阅器 += `, 当前使用的Socks5 ${parsedSocks5Address.hostname}:${String(parsedSocks5Address.port)}`;
else 订阅器 += `, 当前使用的ProxyIP ${proxyIPs.join(', ')}`;
if (enableSocks) 订阅器 += `, 当前使用的Socks5: ${parsedSocks5Address.hostname}:${String(parsedSocks5Address.port)}`;
else 订阅器 += `, 当前使用的ProxyIP: ${proxyIPs.join(', ')}`;
}
return `
################################################################
@@ -1597,6 +1597,16 @@ function subAddresses(host,UUID,noTLS,newAddressesapi,newAddressescsv,newAddress
addressid = match[3] || address;
}
const httpPorts = ["8080","8880","2052","2082","2086","2095"];
if (!isValidIPv4(address) && port == "80") {
for (let httpPort of httpPorts) {
if (address.includes(httpPort)) {
port = httpPort;
break;
}
}
}
let 伪装域名 = host ;
let 最终路径 = '/?ed=2560' ;
let 节点备注 = '';
@@ -1648,6 +1658,16 @@ function subAddresses(host,UUID,noTLS,newAddressesapi,newAddressescsv,newAddress
port = match[2] || port;
addressid = match[3] || address;
}
const httpsPorts = ["2053","2083","2087","2096","8443"];
if (!isValidIPv4(address) && port == "443") {
for (let httpsPort of httpsPorts) {
if (address.includes(httpsPort)) {
port = httpsPort;
break;
}
}
}
let 伪装域名 = host ;
let 最终路径 = '/?ed=2560' ;
@@ -1692,3 +1712,8 @@ async function sendMessage(type, ip, add_data = "") {
});
}
}
function isValidIPv4(address) {
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
return ipv4Regex.test(address);
}