wip: hysteria2

仅通过编译不代表能用

Co-authored-by: xchacha20-poly1305 <139959885+xchacha20-poly1305@users.noreply.github.com>
This commit is contained in:
HystericalDragon
2023-09-02 11:50:09 +08:00
committed by arm64v8a
parent ff3696772c
commit aad4063ef7
10 changed files with 154 additions and 17 deletions

View File

@@ -199,13 +199,25 @@ namespace NekoGui_fmt {
if (!hopPort.trimmed().isEmpty()) outbound["hop_ports"] = hopPort;
if (authPayloadType == hysteria_auth_base64) outbound["auth"] = authPayload;
if (authPayloadType == hysteria_auth_string) outbound["auth_str"] = authPayload;
} else if (proxy_type == proxy_Hysteria2) {
outbound["type"] = "hysteria2";
outbound["password"] = authPayload;
if (uploadMbps > 0) outbound["up_mbps"] = uploadMbps;
if (downloadMbps > 0) outbound["down_mbps"] = downloadMbps;
if (!obfsPassword.isEmpty()) {
outbound["obfs"] = QJsonObject{
{"type", "salamander"},
{"password", obfsPassword},
};
}
} else if (proxy_type == proxy_TUIC) {
outbound["type"] = "tuic";
outbound["uuid"] = uuid;
outbound["password"] = password;
outbound["congestion_control"] = congestionControl;
if (uos) {
outbound["udp_over_stream"]= true;
outbound["udp_over_stream"] = true;
} else {
outbound["udp_relay_mode"] = udpRelayMode;
}