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

@@ -593,6 +593,17 @@ let
`null`: answer 404.
'' "https://www.example.com";
hysteria.rewriteHost = mkOption {
type = types.bool;
default = true;
description = ''
Ask `masquerade` for its own name, whatever name the client asked for. `false`
passes the client's on, for a `masquerade` that is this host's own web server: a
probe then gets the site it named, as it would over TCP, instead of the same one
for every name. Another operator's site would answer those names with an error.
'';
};
hysteria.salamander = {
enable = mkOption {
type = types.bool;
@@ -856,6 +856,9 @@ let
(mkAssertion (
!proxyInboundsEnabled || l.hysteria.masquerade == null || l.type == "hysteria2"
) "${prefix}: hysteria.masquerade is for hysteria2 listeners only")
(mkAssertion (
!proxyInboundsEnabled || l.hysteria.rewriteHost || l.hysteria.masquerade != null
) "${prefix}: hysteria.rewriteHost = false needs hysteria.masquerade")
(mkAssertion (
!proxyInboundsEnabled
|| (!l.hysteria.salamander.enable && l.hysteria.portHopping == null)