更新README.md,添加SOCKS5默认激活说明;修复代理IP解析逻辑以支持URL解码

This commit is contained in:
cmliu
2025-05-07 15:32:09 +08:00
parent a4906bbb9d
commit 25ccf43f6f
2 changed files with 4 additions and 3 deletions

View File

@@ -230,8 +230,8 @@
```url ```url
/socks5=user:password@127.0.0.1:1080 /socks5=user:password@127.0.0.1:1080
/?socks5=user:password@127.0.0.1:1080 /?socks5=user:password@127.0.0.1:1080
/socks://dXNlcjpwYXNzd29yZA==@127.0.0.1:1080 /socks://dXNlcjpwYXNzd29yZA==@127.0.0.1:1080 (默认激活全局SOCKS5)
/socks5://user:password@127.0.0.1:1080 /socks5://user:password@127.0.0.1:1080 (默认激活全局SOCKS5)
``` ```
5. **当你的`ADDAPI`可作为`PROXYIP`时,可在`ADDAPI`变量末位添加`?proxyip=true`即可在生成节点时使用优选IP自身作为`PROXYIP`** 5. **当你的`ADDAPI`可作为`PROXYIP`时,可在`ADDAPI`变量末位添加`?proxyip=true`即可在生成节点时使用优选IP自身作为`PROXYIP`**

View File

@@ -213,11 +213,12 @@ export default {
else if (new RegExp('/socks://', 'i').test(url.pathname) || new RegExp('/socks5://', 'i').test(url.pathname)) { else if (new RegExp('/socks://', 'i').test(url.pathname) || new RegExp('/socks5://', 'i').test(url.pathname)) {
socks5Address = url.pathname.split('://')[1].split('#')[0]; socks5Address = url.pathname.split('://')[1].split('#')[0];
if (socks5Address.includes('@')) { if (socks5Address.includes('@')) {
let userPassword = socks5Address.split('@')[0]; let userPassword = socks5Address.split('@')[0].replaceAll('%3D', '=');
const base64Regex = /^(?:[A-Z0-9+/]{4})*(?:[A-Z0-9+/]{2}==|[A-Z0-9+/]{3}=)?$/i; const base64Regex = /^(?:[A-Z0-9+/]{4})*(?:[A-Z0-9+/]{2}==|[A-Z0-9+/]{3}=)?$/i;
if (base64Regex.test(userPassword) && !userPassword.includes(':')) userPassword = atob(userPassword); if (base64Regex.test(userPassword) && !userPassword.includes(':')) userPassword = atob(userPassword);
socks5Address = `${userPassword}@${socks5Address.split('@')[1]}`; socks5Address = `${userPassword}@${socks5Address.split('@')[1]}`;
} }
go2Socks5s = ['all in'];
} }
if (socks5Address) { if (socks5Address) {