Skip to content

Commit 9bcda1e

Browse files
IceCodeNewriolurs
authored andcommitted
feat: proxyToLoon supports Hysteria2 (tindy2013#871)
https://t.me/LoonNews/1197 Loon supports Hysteria2 since 2023-11-21 in 3.1.3 It seems to be the right time making proxyToLoon supports Hysteria2
1 parent 7af8bf5 commit 9bcda1e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/generator/config/subexport.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,6 +2154,16 @@ std::string proxyToLoon(std::vector<Proxy> &nodes, const std::string &base_conf,
21542154
proxy += ", keepalive=" + std::to_string(x.KeepAlive);
21552155
proxy += ", peers=[{" + generatePeer(x, true) + "}]";
21562156
break;
2157+
case ProxyType::Hysteria2:
2158+
proxy = "hysteria2," + hostname + "," + port + ",\"" + password + "\"";
2159+
2160+
if(!scv.is_undef())
2161+
proxy += ",skip-cert-verify=" + std::string(scv.get() ? "true" : "false");
2162+
if(!x.Fingerprint.empty())
2163+
proxy += ",tls-cert-sha256=" + x.Fingerprint;
2164+
if(!x.SNI.empty())
2165+
proxy += ",sni=" + x.SNI;
2166+
break;
21572167
default:
21582168
continue;
21592169
}

0 commit comments

Comments
 (0)