feat: hy2 host rewrite

This commit is contained in:
fufsob committed 2026-10-11 16:27:16 +00:00
1 parent 5045c13153
commit cae589626a
9 files changed
+56 -5

No files matched your search

+5 -1
View File
@@ -465,7 +465,11 @@ class RoundTripTests(unittest.TestCase):
self.assertEqual(stream["network"], "hysteria")
self.assertEqual(stream["security"], "tls")
self.assertEqual(stream["tlsSettings"]["alpn"], ["h3"])
self.assertEqual(stream["hysteriaSettings"]["masquerade"]["url"], "https://www.example.com")
self.assertEqual(stream["hysteriaSettings"]["masquerade"],
{"type": "proxy", "url": "https://www.example.com", "rewriteHost": True})
# This host's own web server: the name the client asked for goes on to it.
own = render_xray_inbound(dict(spec, hysteria={"masquerade": "https://www.example.com", "rewriteHost": False}))
self.assertFalse(own["streamSettings"]["hysteriaSettings"]["masquerade"]["rewriteHost"])
link = build_share_link(spec, "vpn.example.com")
self.assertTrue(link.startswith("hysteria2://p%40ss%2Fword@vpn.example.com:8443?"), link)
self.assertEqual(link_params(link)["alpn"], "h3")