feat: hysteria2 x-forward

This commit is contained in:
fufsob committed 2026-10-11 16:27:16 +00:00
1 parent cae589626a
commit 7d96e7c6f8
9 files changed
+54 -6

No files matched your search

+4 -2
View File
@@ -468,8 +468,10 @@ class RoundTripTests(unittest.TestCase):
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"])
own = render_xray_inbound(dict(spec, hysteria={"masquerade": "https://www.example.com", "rewriteHost": False,
"xForwarded": True}))
self.assertEqual(own["streamSettings"]["hysteriaSettings"]["masquerade"],
{"type": "proxy", "url": "https://www.example.com", "rewriteHost": False, "xForwarded": True})
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")