New Transparent capture is in preview. Record every app's traffic with no proxy configuration, on Windows, macOS and Linux. Learn more

hostFilter Filter

Match exchanges by destination hostname, ignoring the port, with exact, regex, or substring matching for surgical rule scoping.

Scoping rules by hostname is the single most common pattern in any real Fluxzy ruleset, because most decisions about TLS, authentication, or mocking depend on where the traffic is going. The hostFilter is the workhorse for that selection: it matches by name only, ignoring the port, and supports exact, regex, and substring operations for whatever level of precision your workflow needs.

When to use this filter

Use hostFilter whenever a rule should be scoped by destination hostname, ignoring the port. The filter is evaluated as soon as Fluxzy knows the authority (during the CONNECT request for HTTPS, or from the request line for HTTP), so it composes cleanly with TLS, header, and routing actions.

Common situations:

  • Applying credentials, certificates, or mock responses to one production host only.
  • Skipping TLS inspection for a host that uses certificate pinning.
  • Carving up a busy capture by hostname for triage and reporting.

For host plus port matching, use authorityFilter instead.

Real world examples

Apply a rule only to a single hostname

Force a specific TLS version for an upstream service that struggles with newer protocols.

rules:
- filter:
    typeKind: HostFilter
    pattern: legacy-api.example.com
    operation: Exact
  actions:
  - typeKind: ForceTlsVersionAction
    tlsVersion: Tls12

Match every subdomain of a domain with regex

Cover every subdomain of example.com without having to enumerate them.

rules:
- filter:
    typeKind: HostFilter
    pattern: '.*\.example\.com$'
    operation: Regex
  actions:
  - typeKind: ApplyTagAction
    tag:
      value: example-domain

Skip TLS tunneling for a pinning sensitive host

Bypass interception when the destination uses certificate pinning that would break otherwise.

rules:
- filter:
    typeKind: HostFilter
    pattern: pinned.example.com
    operation: Exact
  actions:
  - typeKind: SkipSslTunnelingAction

Reference

hostFilter

Description

Select exchanges according to hostname (excluding port). To select authority (combination of host:port), use AuthorityFilter.

Evaluation scope

Evaluation scope defines the timing where this filter will be applied.

onAuthorityReceived This scope denotes the moment fluxzy is aware the destination authority. In a regular proxy connection, it will occur the moment where fluxzy parsed the CONNECT request.

YAML configuration name

hostFilter

Settings

The following table describes the customizable properties available for this filter:

Property Type Description DefaultValue
pattern string The string pattern to search
operation exact | contains | startsWith | endsWith | regex The search operation performed exact
caseSensitive boolean true if the Search should be case sensitive false
inverted boolean Negate the filter result false

Example of usage

The following examples apply a comment to the filtered exchange

Retains only exchanges with the exact host.

rules:
- filter:
    typeKind: HostFilter
    pattern: www.fluxzy.io
    operation: Exact
  actions:
  - typeKind: ApplyCommentAction
    comment: filter was applied

Retains only exchanges with a host matching the regex.

rules:
- filter:
    typeKind: HostFilter
    pattern: ^www\.fluxzy\.io$
    operation: Regex
  actions:
  - typeKind: ApplyCommentAction
    comment: filter was applied

.NET reference

View definition of HostFilter for .NET integration.

See also

The following filters are related to this filter:

Frequently asked questions

What is the difference with authorityFilter?

hostFilter matches the hostname only, ignoring the port. authorityFilter matches the host plus port combination, which is useful when several services share a name but listen on different ports.

Can the match be case insensitive?

Set caseSensitive: false (the default) for case insensitive matching, mirroring DNS semantics. Flip it to true only if you have a reason to care about case.

Which operation should I pick by default?

Exact is the safest default and matches the upstream documentation. Use Regex for sub domain wildcards, and Contains for quick exploratory rules during debugging.

Learn more about Fluxzy rules