fix: trojan uri and tls

This commit is contained in:
xream
2023-08-24 10:02:03 +08:00
parent 497bc264e3
commit 1f505752ae
6 changed files with 75 additions and 14 deletions

View File

@@ -79,7 +79,7 @@ port = digits:[0-9]+ {
}
}
params = "?" head:param tail:("&"@param)* {
params = "/"? "?" head:param tail:("&"@param)* {
proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);
proxy.sni = params["sni"] || params["peer"];
@@ -87,6 +87,15 @@ params = "?" head:param tail:("&"@param)* {
proxy.network = "ws";
$set(proxy, "ws-opts.path", params["wspath"]);
}
if (params["type"]) {
proxy.network = params["type"]
if (params["path"]) {
$set(proxy, proxy.network+"-opts.path", decodeURIComponent(params["path"]));
}
if (params["host"]) {
$set(proxy, proxy.network+"-opts.headers.Host", decodeURIComponent(params["host"]));
}
}
proxy.udp = toBool(params["udp"]);
proxy.tfo = toBool(params["tfo"]);

View File

@@ -77,7 +77,7 @@ port = digits:[0-9]+ {
}
}
params = "?" head:param tail:("&"@param)* {
params = "/"? "?" head:param tail:("&"@param)* {
proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);
proxy.sni = params["sni"] || params["peer"];
@@ -85,6 +85,16 @@ params = "?" head:param tail:("&"@param)* {
proxy.network = "ws";
$set(proxy, "ws-opts.path", params["wspath"]);
}
if (params["type"]) {
proxy.network = params["type"]
if (params["path"]) {
$set(proxy, proxy.network+"-opts.path", decodeURIComponent(params["path"]));
}
if (params["host"]) {
$set(proxy, proxy.network+"-opts.headers.Host", decodeURIComponent(params["host"]));
}
}
proxy.udp = toBool(params["udp"]);
proxy.tfo = toBool(params["tfo"]);