Add Hy2 for Loon.(#22)

This commit is contained in:
asdlokj1qpi23
2024-06-13 17:29:22 +08:00
parent 43fc751a2d
commit 6c296bfbf2

View File

@@ -1982,6 +1982,14 @@ proxyToLoon(std::vector<Proxy> &nodes, const std::string &base_conf, std::vector
proxy += ", keepalive=" + std::to_string(x.KeepAlive);
proxy += ", peers=[{" + generatePeer(x, true) + "}]";
break;
case ProxyType::Hysteria2:
proxy = "Hysteria2," + hostname + "," + port + "," + username + ",\"" + password + "\"";
if(!x.ServerName.empty()){
proxy += ",sni="+x.ServerName;
}
if(!x.DownMbps.empty()){
proxy += ",download-bandwidth="+x.DownMbps;
}
default:
continue;
}