Support 2022-blake3 share

pull/2415/head
2dust 2022-05-31 14:53:39 +08:00
parent 7903228c13
commit f597f09914
1 changed files with 21 additions and 8 deletions

View File

@ -594,9 +594,21 @@ namespace v2rayN.Handler
address = parsedUrl.IdnHost,
port = parsedUrl.Port,
};
// parse base64 UserInfo
string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.UriEscaped);
//2022-blake3
if (rawUserInfo.Contains(":"))
{
string[] userInfoParts = rawUserInfo.Split(new char[] { ':' }, 2);
if (userInfoParts.Length != 2)
{
return null;
}
server.security = userInfoParts[0];
server.id = Utils.UrlDecode(userInfoParts[1]);
}
else
{
// parse base64 UserInfo
string userInfo = Utils.Base64Decode(rawUserInfo);
string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2);
if (userInfoParts.Length != 2)
@ -605,6 +617,7 @@ namespace v2rayN.Handler
}
server.security = userInfoParts[0];
server.id = userInfoParts[1];
}
NameValueCollection queryParameters = HttpUtility.ParseQueryString(parsedUrl.Query);
if (queryParameters["plugin"] != null)