feat: add sharelink for TUIC

This commit is contained in:
2022-blake3-chacha12-poly1305
2023-08-11 10:19:15 +08:00
committed by HystericalDragon
parent 1c6fe29ea6
commit e6fc84e97b
3 changed files with 45 additions and 6 deletions

View File

@@ -198,8 +198,23 @@ namespace NekoGui_fmt {
if (streamReceiveWindow > 0) q.addQueryItem("recv_window_conn", Int2String(streamReceiveWindow));
if (!q.isEmpty()) url.setQuery(q);
if (!name.isEmpty()) url.setFragment(name);
} else if (proxy_type == proxy_TUIC) {
// TODO std link
url.setScheme("tuic");
url.setUserName(uuid);
url.setPassword(password);
url.setHost(serverAddress);
url.setPort(serverPort);
QUrlQuery q;
if (!congestionControl.isEmpty()) q.addQueryItem("congestion_control", congestionControl);
if (!alpn.isEmpty()) q.addQueryItem("alpn", alpn);
if (!sni.isEmpty()) q.addQueryItem("sni", sni);
if (!udpRelayMode.isEmpty()) q.addQueryItem("udp_relay_mode", udpRelayMode);
if (allowInsecure) q.addQueryItem("allow_insecure", "1");
if (disableSni) q.addQueryItem("disable_sni", "1");
if (!q.isEmpty()) url.setQuery(q);
if (!name.isEmpty()) url.setFragment(name);
}
return url.toString(QUrl::FullyEncoded);
}