Skip to content

Commit

Permalink
避免项目被滥用,现已取消内置订阅器
Browse files Browse the repository at this point in the history
  • Loading branch information
cmliu committed Sep 9, 2024
1 parent 64f171e commit 60f4a23
Showing 1 changed file with 32 additions and 15 deletions.
47 changes: 32 additions & 15 deletions _worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ 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 sub = '';// 避免项目被滥用,现已取消内置订阅器
let subconverter = 'SUBAPI.fxxk.dedyn.io';// clash订阅转换后端,目前使用CM的订阅转换功能。自带虚假uuid和host订阅。
let subconfig = "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online.ini"; //订阅配置文件
let subconfig = "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_MultiMode.ini"; //订阅配置文件
let subProtocol = 'https';
// The user name and password do not contain special characters
// Setting the address will ignore proxyIP
Expand All @@ -32,11 +32,37 @@ const expire = 4102329600;//2099-12-31
let proxyIPs;
let socks5s;
let go2Socks5s = [
'*ttvnw.net'
'*ttvnw.net',
];
let addresses = [
//当sub为空时启用本地优选域名/优选IP,若不带端口号 TLS默认端口为443,#号后为备注别名
'Join.my.Telegram.channel.CMLiussss.to.unlock.more.premium.nodes.cf.090227.xyz#加入我的频道t.me/CMLiussss解锁更多优选节点',
'visa.cn:443',
'www.visa.com:8443',
'cis.visa.com:2053',
'africa.visa.com:2083',
'www.visa.com.sg:2087',
'www.visaeurope.at:2096',
'www.visa.com.mt:8443',
'qa.visamiddleeast.com',
'time.is',
'www.wto.org:8443',
'chatgpt.com:2087',
'icook.hk',
//'104.17.0.0#IPv4',
'[2606:4700::]#IPv6'
];
let addresses = [];
let addressesapi = [];
let addressesnotls = [];
let addressesnotls = [
//当sub为空且域名带有"worker"字样时启用本地优选域名/优选IP,若不带端口号 noTLS默认端口为80,#号后为备注别名
'usa.visa.com',
'myanmar.visa.com:8080',
'www.visa.com.tw:8880',
'www.visaeurope.ch:2052',
'www.visa.com.br:2082',
'www.visasoutheasteurope.com:2086',
'[2606:4700::1]:2095#IPv6'
];
let addressesnotlsapi = [];
let addressescsv = [];
let DLS = 8;
Expand Down Expand Up @@ -130,15 +156,6 @@ export default {
return new Response(`${fakeConfig}`, { status: 200 });
case `/${userID}`: {
await sendMessage(`#获取订阅 ${FileName}`, request.headers.get('CF-Connecting-IP'), `UA: ${UA}</tg-spoiler>\n域名: ${url.hostname}\n<tg-spoiler>入口: ${url.pathname + url.search}</tg-spoiler>`);
if ((!sub || sub == '') && (addresses.length + addressesapi.length + addressesnotls.length + addressesnotlsapi.length + addressescsv.length) == 0){
if (request.headers.get('Host').includes(".workers.dev")) {
sub = 'noTLS.fxxk.dedyn.io';
subconfig = env.SUBCONFIG || 'https://raw.githubusercontent.com/cmliu/ACL4SSR/main/Clash/config/ACL4SSR_Online.ini';
} else {
sub = 'VLESS.fxxk.dedyn.io';
subconfig = env.SUBCONFIG || "https://raw.githubusercontent.com/cmliu/ACL4SSR/main/Clash/config/ACL4SSR_Online_Full_MultiMode.ini";
}
}
const vlessConfig = await getVLESSConfig(userID, request.headers.get('Host'), sub, UA, RproxyIP, url);
const now = Date.now();
//const timestamp = Math.floor(now / 1000);
Expand Down Expand Up @@ -1265,7 +1282,7 @@ async function getVLESSConfig(userID, hostName, sub, UA, RproxyIP, _url) {
let socks5List = '';
if( go2Socks5s.length > 0 && enableSocks ) {
socks5List = `${decodeURIComponent('SOCKS5%EF%BC%88%E7%99%BD%E5%90%8D%E5%8D%95%EF%BC%89%3A%20')}`;
if ( go2Socks5s.includes(atob('YWxsIGlu')) || go2Socks5s.includes(atob('Kg==')) ) socks5List += `${decodeURIComponent('%E6%89%80%E6%9C%89%E6%B5%81%E9%87%8F')}\n`;
if (go2Socks5s.includes(atob('YWxsIGlu'))||go2Socks5s.includes(atob('Kg=='))) socks5List += `${decodeURIComponent('%E6%89%80%E6%9C%89%E6%B5%81%E9%87%8F')}\n`;
else socks5List += `\n ${go2Socks5s.join('\n ')}\n`;
}

Expand Down

0 comments on commit 60f4a23

Please sign in to comment.