Skip to content

Commit

Permalink
美化优选订阅列表编辑UI;
Browse files Browse the repository at this point in the history
添加黑名单,默认屏蔽cf测速域保护ProxyIP;
  • Loading branch information
cmliu committed Dec 12, 2024
1 parent a6802f1 commit 37ed483
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions 明文源码.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ let proxyIPPool = [];
let path = '/?ed=2560';
let 动态UUID;
let link = [];
let banHosts = [atob('c3BlZWQuY2xvdWRmbGFyZS5jb20=')];
export default {
async fetch(request, env, ctx) {
try {
Expand Down Expand Up @@ -93,7 +94,7 @@ export default {
socks5Address = socks5Address.split('//')[1] || socks5Address;
if (env.GO2SOCKS5) go2Socks5s = await 整理(env.GO2SOCKS5);
if (env.CFPORTS) httpsPorts = await 整理(env.CFPORTS);

if (env.BAN) banHosts = await 整理(env.BAN);
if (socks5Address) {
try {
parsedSocks5Address = socks5AddressParser(socks5Address);
Expand Down Expand Up @@ -329,8 +330,13 @@ async function 维列斯OverWSHandler(request) {
return handleDNSQuery(rawClientData, webSocket, 维列斯ResponseHeader, log);
}
// 处理 TCP 出站连接
log(`处理 TCP 出站连接 ${addressRemote}:${portRemote}`);
handleTCPOutBound(remoteSocketWapper, addressType, addressRemote, portRemote, rawClientData, webSocket, 维列斯ResponseHeader, log);
if (!banHosts.includes(addressRemote)) {
log(`处理 TCP 出站连接 ${addressRemote}:${portRemote}`);
handleTCPOutBound(remoteSocketWapper, addressType, addressRemote, portRemote, rawClientData, webSocket, 维列斯ResponseHeader, log);
} else {
log(`黑名单关闭 TCP 出站连接 ${addressRemote}:${portRemote}`);
tcpSocket.close();
}
},
close() {
log(`readableWebSocketStream 已关闭`);
Expand Down Expand Up @@ -1204,7 +1210,7 @@ function 配置信息(UUID, 域名地址) {
}

let subParams = ['sub','base64','b64','clash','singbox','sb'];

const cmad = decodeURIComponent(atob('dGVsZWdyYW0lMjAlRTQlQkElQTQlRTYlQjUlODElRTclQkUlQTQlMjAlRTYlOEElODAlRTYlOUMlQUYlRTUlQTQlQTclRTQlQkQlQUMlN0UlRTUlOUMlQTglRTclQkElQkYlRTUlOEYlOTElRTclODklOEMhJTNDYnIlM0UKJTNDYSUyMGhyZWYlM0QlMjdodHRwcyUzQSUyRiUyRnQubWUlMkZDTUxpdXNzc3MlMjclM0VodHRwcyUzQSUyRiUyRnQubWUlMkZDTUxpdXNzc3MlM0MlMkZhJTNFJTNDYnIlM0UKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tJTNDYnIlM0UKZ2l0aHViJTIwJUU5JUExJUI5JUU3JTlCJUFFJUU1JTlDJUIwJUU1JTlEJTgwJTIwU3RhciFTdGFyIVN0YXIhISElM0NiciUzRQolM0NhJTIwaHJlZiUzRCUyN2h0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmNtbGl1JTJGZWRnZXR1bm5lbCUyNyUzRWh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmNtbGl1JTJGZWRnZXR1bm5lbCUzQyUyRmElM0UlM0NiciUzRQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0lM0NiciUzRQolMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjM='));
/**
* @param {string} userID
* @param {string | null} hostName
Expand Down Expand Up @@ -1404,7 +1410,7 @@ async function 生成配置信息(userID, hostName, sub, UA, RproxyIP, _url, env
${clash}<br>
---------------------------------------------------------------<br>
################################################################<br>
${decodeURIComponent(atob('dGVsZWdyYW0lMjAlRTQlQkElQTQlRTYlQjUlODElRTclQkUlQTQlMjAlRTYlOEElODAlRTYlOUMlQUYlRTUlQTQlQTclRTQlQkQlQUMlN0UlRTUlOUMlQTglRTclQkElQkYlRTUlOEYlOTElRTclODklOEMhJTNDYnIlM0UKJTNDYSUyMGhyZWYlM0QlMjdodHRwcyUzQSUyRiUyRnQubWUlMkZDTUxpdXNzc3MlMjclM0VodHRwcyUzQSUyRiUyRnQubWUlMkZDTUxpdXNzc3MlM0MlMkZhJTNFJTNDYnIlM0UKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tJTNDYnIlM0UKZ2l0aHViJTIwJUU5JUExJUI5JUU3JTlCJUFFJUU1JTlDJUIwJUU1JTlEJTgwJTIwU3RhciFTdGFyIVN0YXIhISElM0NiciUzRQolM0NhJTIwaHJlZiUzRCUyN2h0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmNtbGl1JTJGZWRnZXR1bm5lbCUyNyUzRWh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmNtbGl1JTJGZWRnZXR1bm5lbCUzQyUyRmElM0UlM0NiciUzRQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0lM0NiciUzRQolMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjM='))}
${cmad}
`;
return 节点配置页;
} else {
Expand Down Expand Up @@ -1900,13 +1906,13 @@ async function KV(request, env, txt = '/ADD.txt') {
<!DOCTYPE html>
<html>
<head>
<title>KV编辑器</title>
<title>优选订阅列表</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
margin: 0;
padding: 20px;
padding: 15px; /* 调整padding */
box-sizing: border-box;
font-size: 13px; /* 设置全局字体大小 */
}
Expand All @@ -1917,25 +1923,25 @@ async function KV(request, env, txt = '/ADD.txt') {
}
.editor {
width: 100%;
height: 520px;
margin: 20px 0;
padding: 15px;
height: 520px; /* 调整高度 */
margin: 15px 0; /* 调整margin */
padding: 10px; /* 调整padding */
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
font-size: 13px;
line-height: 1.5;
overflow-y: auto;
resize: none;
}
.save-container {
margin-top: 10px;
margin-top: 8px; /* 调整margin */
display: flex;
align-items: center;
gap: 15px;
gap: 10px; /* 调整gap */
}
.save-btn, .back-btn {
padding: 8px 20px;
padding: 6px 15px; /* 调整padding */
color: white;
border: none;
border-radius: 4px;
Expand All @@ -1959,6 +1965,9 @@ async function KV(request, env, txt = '/ADD.txt') {
</style>
</head>
<body>
################################################################<br>
${FileName} 优选订阅列表:<br>
---------------------------------------------------------------<br>
<div class="editor-container">
${hasKV ? `
<textarea class="editor"
Expand All @@ -1969,6 +1978,9 @@ async function KV(request, env, txt = '/ADD.txt') {
<button class="save-btn" onclick="saveContent()">保存</button>
<span class="save-status" id="saveStatus"></span>
</div>
<br>
################################################################<br>
${cmad}
` : '<p>未绑定KV空间</p>'}
</div>
Expand Down

0 comments on commit 37ed483

Please sign in to comment.