> ## Documentation Index
> Fetch the complete documentation index at: https://docs.httpmon.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Host filtering

> Block or allow hosts at the proxy layer with wildcard patterns

Host filtering lets you control which traffic httpmon intercepts. You can block noisy hosts or limit capture to only the hosts you care about.

## Block hosts

Use `--block` to intercept everything except the matched hosts. Separate multiple patterns with commas.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
httpmon --block "*.ads.com,*.tracking.com"
```

Blocked hosts pass through the proxy without being captured in the flow list.

## Allow hosts

Use `--allow` to intercept only the matched hosts. Everything else passes through untouched.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
httpmon --allow "api.example.com,*.internal"
```

This is useful when you want to focus on a specific API or set of services.

## Priority

Allow takes priority over block. If a host matches both an allow pattern and a block pattern, httpmon intercepts it.

## Wildcard matching

Patterns use `*` as a wildcard on the hostname. The port is stripped before matching.

| Pattern         | Matches                             |
| --------------- | ----------------------------------- |
| `*.ads.com`     | `tracker.ads.com`, `cdn.ads.com`    |
| `api.example.*` | `api.example.com`, `api.example.io` |
| `*.internal`    | `service.internal`, `db.internal`   |

## Common examples

**Block analytics and ads:**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
httpmon --block "*.analytics.com,*.ads.com,*.tracking.io"
```

**Focus on your API:**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
httpmon --allow "api.myapp.com,auth.myapp.com"
```

**Block a single noisy host:**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
httpmon --block "telemetry.vendor.com"
```

<Frame>
  <img src="https://mintcdn.com/pragmaticoslu/GKMvH6x25ZdEJHbo/images/screenshots/host-filtering.png?fit=max&auto=format&n=GKMvH6x25ZdEJHbo&q=85&s=461ac43cf7cfa800cf644885b3cc4f99" alt="httpmon host filtering" width="5877" height="1904" data-path="images/screenshots/host-filtering.png" />
</Frame>
