fix naive link

This commit is contained in:
arm64v8a
2022-08-30 14:29:31 +08:00
parent a0e42ec28e
commit dbfe4258b7
3 changed files with 5 additions and 2 deletions

View File

@@ -81,7 +81,7 @@ namespace NekoRay::fmt {
QString NaiveBean::ToShareLink() {
QUrl url;
url.setScheme("https+naive");
url.setScheme("naive+" + protocol);
url.setUserName(username);
url.setPassword(password);
url.setHost(serverAddress);

View File

@@ -136,6 +136,9 @@ namespace NekoRay::fmt {
auto url = QUrl(link);
if (!url.isValid()) return false;
protocol = url.scheme().replace("naive+", "");
if (protocol != "https" && protocol != "quic") return false;
name = url.fragment(QUrl::FullyDecoded);
serverAddress = url.host();
serverPort = url.port();

View File

@@ -101,7 +101,7 @@ namespace NekoRay::sub {
}
// Naive
if (str.startsWith("https+naive://")) {
if (str.startsWith("naive+")) {
ent = ProfileManager::NewProxyEntity("naive");
auto ok = ent->NaiveBean()->TryParseLink(str);
if (!ok) return;