Skip to content

Commit

Permalink
提高路由订阅适配
Browse files Browse the repository at this point in the history
  • Loading branch information
cmliu committed Jan 26, 2025
1 parent 5ba1450 commit 7912508
Show file tree
Hide file tree
Showing 2 changed files with 2,207 additions and 11 deletions.
2,196 changes: 2,195 additions & 1 deletion _worker.js

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions 明文源码.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default {
let total = 24 * 1099511627776;

if (userAgent && userAgent.includes('mozilla')) {
return new Response(`<div style="font-size:13px;">${维列斯Config}</div>`, {
return new Response(维列斯Config, {
status: 200,
headers: {
"Content-Type": "text/html;charset=utf-8",
Expand All @@ -186,11 +186,11 @@ export default {
}
});
} else {
return new Response(`${维列斯Config}`, {
return new Response(维列斯Config, {
status: 200,
headers: {
"Content-Disposition": `attachment; filename=${FileName}; filename*=utf-8''${encodeURIComponent(FileName)}`,
"Content-Type": "text/plain;charset=utf-8",
//"Content-Type": "text/plain;charset=utf-8",
"Profile-Update-Interval": "6",
"Subscription-Userinfo": `upload=${pagesSum}; download=${workersSum}; total=${total}; expire=${expire}`,
}
Expand Down Expand Up @@ -1380,18 +1380,20 @@ async function 生成配置信息(userID, hostName, sub, UA, RproxyIP, _url, fak
<div id="qrcode_3" style="margin: 10px 10px 10px 10px;"></div>
<strong><a href="javascript:void(0);" id="noticeToggle" onclick="toggleNotice()">实用订阅技巧∨</a></strong><br>
<div id="noticeContent" class="notice-content" style="display: none;">
<strong>1.</strong> 如您使用的是 PassWall、SSR+ 等路由插件,推荐使用 <strong>Base64订阅地址</strong> 进行订阅;<br>
<strong>1.</strong> 如您使用的是 PassWall、PassWall2 路由插件,订阅编辑的 <strong>用户代理(User-Agent)</strong> 设置为 <strong>PassWall</strong> 即可;<br>
<br>
<strong>2.</strong> 快速切换 <a href='${atob('aHR0cHM6Ly9naXRodWIuY29tL2NtbGl1L1dvcmtlclZsZXNzMnN1Yg==')}'>优选订阅生成器</a> 至:sub.google.com,您可将"?sub=sub.google.com"参数添加到链接末尾,例如:<br>
<strong>2.</strong> 如您使用的是 SSR+ 路由插件,推荐使用 <strong>Base64订阅地址</strong> 进行订阅;<br>
<br>
<strong>3.</strong> 快速切换 <a href='${atob('aHR0cHM6Ly9naXRodWIuY29tL2NtbGl1L1dvcmtlclZsZXNzMnN1Yg==')}'>优选订阅生成器</a> 至:sub.google.com,您可将"?sub=sub.google.com"参数添加到链接末尾,例如:<br>
&nbsp;&nbsp;https://${proxyhost}${hostName}/${uuid}<strong>?sub=sub.google.com</strong><br>
<br>
<strong>3.</strong> 快速更换 PROXYIP 至:proxyip.fxxk.dedyn.io:443,您可将"?proxyip=proxyip.fxxk.dedyn.io:443"参数添加到链接末尾,例如:<br>
<strong>4.</strong> 快速更换 PROXYIP 至:proxyip.fxxk.dedyn.io:443,您可将"?proxyip=proxyip.fxxk.dedyn.io:443"参数添加到链接末尾,例如:<br>
&nbsp;&nbsp; https://${proxyhost}${hostName}/${uuid}<strong>?proxyip=proxyip.fxxk.dedyn.io:443</strong><br>
<br>
<strong>4.</strong> 快速更换 SOCKS5 至:user:[email protected]:1080,您可将"?socks5=user:[email protected]:1080"参数添加到链接末尾,例如:<br>
<strong>5.</strong> 快速更换 SOCKS5 至:user:[email protected]:1080,您可将"?socks5=user:[email protected]:1080"参数添加到链接末尾,例如:<br>
&nbsp;&nbsp;https://${proxyhost}${hostName}/${uuid}<strong>?socks5=user:[email protected]:1080</strong><br>
<br>
<strong>5.</strong> 如需指定多个参数则需要使用'&'做间隔,例如:<br>
<strong>6.</strong> 如需指定多个参数则需要使用'&'做间隔,例如:<br>
&nbsp;&nbsp;https://${proxyhost}${hostName}/${uuid}?sub=sub.google.com<strong>&</strong>proxyip=proxyip.fxxk.dedyn.io<br>
</div>
<script src="https://cdn.jsdelivr.net/npm/@keeex/[email protected]/qrcode.min.js"></script>
Expand Down Expand Up @@ -1451,7 +1453,7 @@ async function 生成配置信息(userID, hostName, sub, UA, RproxyIP, _url, fak
################################################################<br>
${cmad}
`;
return 节点配置页;
return `<div style="font-size:13px;">${节点配置页}</div>`;
} else {
if (typeof fetch != 'function') {
return 'Error: fetch is not available in this environment.';
Expand Down Expand Up @@ -1517,7 +1519,7 @@ async function 生成配置信息(userID, hostName, sub, UA, RproxyIP, _url, fak
console.log(`虚假订阅: ${url}`);
}

if (!userAgent.includes(('CF-Workers-SUB').toLowerCase())) {
if (!userAgent.includes(('CF-Workers-SUB').toLowerCase()) && !_url.searchParams.has('b64') && !_url.searchParams.has('base64')) {
if ((userAgent.includes('clash') && !userAgent.includes('nekobox')) || (_url.searchParams.has('clash') && !userAgent.includes('subconverter'))) {
url = `${subProtocol}://${subConverter}/sub?target=clash&url=${encodeURIComponent(url)}&insert=false&config=${encodeURIComponent(subConfig)}&emoji=${subEmoji}&list=false&tfo=false&scv=true&fdn=false&sort=false&new_name=true`;
isBase64 = false;
Expand Down

0 comments on commit 7912508

Please sign in to comment.