feat(handler/http,http2): support comma-separated hostnames in probeResistance knock

Knock previously accepted a single hostname. Now it accepts multiple
comma-separated hostnames; probe resistance is bypassed if the request
hostname matches any entry in the list. Matching is case-insensitive
and whitespace around entries is trimmed.
This commit is contained in:
ginuerzh
2026-05-28 23:20:27 +08:00
parent 3246b39c93
commit c246a1d4fa
6 changed files with 163 additions and 7 deletions
+1 -1
View File
@@ -148,5 +148,5 @@ func (h *httpHandler) parseMetadata(md mdata.Metadata) error {
type probeResistance struct {
Type string // strategy: "code", "web", "host", or "file"
Value string // strategy-specific parameter (status code, URL, address, path)
Knock string // optional hostname; when set, probe resistance only fires for non-matching hosts
Knock string // optional comma-separated hostnames; probe resistance only fires when the request hostname matches none of them
}