mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 12:34:37 +03:00
fix: tls sni parse
This commit is contained in:
@@ -35,7 +35,7 @@ namespace NekoRay::fmt {
|
||||
password = url.password();
|
||||
if (serverPort == -1) serverPort = socks_http_type == type_HTTP ? 443 : 1080;
|
||||
|
||||
stream->security = GetQueryValue(query, "security", "") == "true" ? "tls" : "none";
|
||||
stream->security = GetQueryValue(query, "security", "");
|
||||
stream->sni = GetQueryValue(query, "sni");
|
||||
}
|
||||
return true;
|
||||
@@ -124,13 +124,7 @@ namespace NekoRay::fmt {
|
||||
auto scy = objN["scy"].toString();
|
||||
if (!scy.isEmpty()) security = scy;
|
||||
// TLS (XTLS?)
|
||||
if (!objN["tls"].toString().isEmpty() && objN["tls"].toString().toLower() != "none")
|
||||
stream->security = "tls";
|
||||
if (stream->security == "tls" && IsIpAddress(serverAddress) &&
|
||||
(!stream->host.isEmpty()) && stream->sni.isEmpty()) {
|
||||
// v2rayN config builder generate sni like this, so set sni here for their format.
|
||||
stream->sni = stream->host;
|
||||
}
|
||||
stream->security = objN["tls"].toString();
|
||||
// TODO quic & kcp
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user