Skip to content

Commit

Permalink
修改出现内置线路的逻辑,避免自定义ADD*变量异常
Browse files Browse the repository at this point in the history
  • Loading branch information
cmliu committed Sep 10, 2024
1 parent 0ae3571 commit ce7c08a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
13 changes: 9 additions & 4 deletions _worker.js

Large diffs are not rendered by default.

29 changes: 25 additions & 4 deletions _worker.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let socks5Address = '';

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',
Expand All @@ -22,8 +23,9 @@ let addresses = [
'www.wto.org:8443',
'chatgpt.com:2087',
'icook.hk',
//'104.17.0.0#IPv4',
'104.17.0.0#IPv4',
'[2606:4700::]#IPv6'
*/
];

let sub = '';
Expand All @@ -41,14 +43,14 @@ let BotToken ='';
let ChatID ='';
let proxyhosts = [];//本地代理域名池
let proxyhostsURL = 'https://raw.githubusercontent.com/cmliu/CFcdnVmess2sub/main/proxyhosts';//在线代理域名池URL
let go2Socks5s = [
'*ttvnw.net',
];

let fakeUserID ;
let fakeHostName ;
let proxyIPs ;
let socks5s;
let go2Socks5s = [
'*ttvnw.net',
];
let sha224Password ;
const expire = 4102329600;//2099-12-31
const regex = /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[.*\]):?(\d+)?#?(.*)?$/;
Expand Down Expand Up @@ -138,6 +140,25 @@ export default {
return new Response(`${fakeConfig}`, { status: 200 });
case `/${password}`:
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){
addresses = [
'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'
];
}
const trojanConfig = await getTrojanConfig(password, request.headers.get('Host'), sub, UA, RproxyIP, url);
const now = Date.now();
//const timestamp = Math.floor(now / 1000);
Expand Down

0 comments on commit ce7c08a

Please sign in to comment.