perf: 优化完善 trojan 协议一些识别问题

1、trojan 不存在选择是否支持TLS这个问题,移除选项。
2、b64decsafe 函数错误将“-”解码为“+”,暂时移除。
3、增加支持识别链接是否允许 “allowInsecure”
This commit is contained in:
zhiqiang.wang 2022-09-21 17:45:14 +08:00
parent 9e138d4870
commit 82a7b907d5
2 changed files with 5 additions and 5 deletions

View File

@ -423,7 +423,6 @@ o = s:option(Flag, 'tls', translate('TLS'))
o.rmempty = true
o.default = '0'
o:depends('type', 'v2ray')
o:depends('type', 'trojan')
o:depends('type', 'vless')
o:depends('type', 'xray')

View File

@ -208,10 +208,9 @@
} else {
url0 = ssu[1]
}
var sstr = b64decsafe(url0);
el('.type').value = "trojan";
el('.type').dispatchEvent(event);
var team = sstr.split('@');
var team = url0.split('@');
var part1 = team[0].split(':');
var part2 = team[1].split(':');
var others = part2[1].split('?');
@ -226,11 +225,13 @@
}
el('.server').value = part2[0];
el('.server_port').value = others[0];
el('.password').value = part1[0];
el('.password').value = decodeURI(part1[0]);
if (queryParam.peer || queryParam.sni) {
el('.tls').checked = true;
el('.peer').value = queryParam.peer || queryParam.sni;
}
if (url0.indexOf('allowInsecure=1') != -1) {
el('.insecure').value = 1;
}
if (param != undefined) {
rema = decodeURI(param)