TechBuzzPro

How to Filter by Host and Port in Chrome DevTools

· 6 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Chrome DevTools doesn't have a dedicated host/port filter box, but you can achieve the same result by typing a hostname or host:port into the Network panel's filter field. For example, typing api.example.com:8080 shows only requests to that host and port. This works because the filter matches against the request URL, which includes both the host and the port when it's non-standard. This guide shows you exactly how to use it, plus the built-in filters that make it even more precise.

What You'll Need

  • Google Chrome (any recent version) on desktop. The Network panel is not available in Chrome on mobile.
  • A page that makes network requests (your own site, a test page, or any site you're debugging).
  • Basic familiarity with opening DevTools (F12 or Ctrl+Shift+I / Cmd+Option+I).

Menu labels and filter behavior can differ slightly between Chrome versions and operating systems, but the core filtering method described here is stable.

Step-by-Step

  1. Open DevTools. Press F12 (Windows/Linux) or Cmd+Option+I (Mac). You can also right-click anywhere on the page and choose Inspect.
  2. Go to the Network panel. Click the Network tab at the top of DevTools. If you don't see it, click the double-arrow (ยป ) to reveal hidden tabs.
  3. Start capturing requests. Reload the page (Ctrl+R or Cmd+R) or interact with the page so requests appear. The Network panel only records while it's open, so if the list is empty, reload.
  4. Locate the filter field. At the top of the Network panel there's a text box labeled "Filter" (or with a magnifying-glass icon). Click inside it.
  5. Type the hostname. For example, type example.com to show only requests whose URL contains that string. This is a substring match, so api.example.com would also match example.com.
  6. Add the port. To narrow to a specific port, type host:port โ€” for example localhost:3000 or api.example.com:8080. The colon and port number are matched as part of the URL, so only requests to that exact host and port remain visible.
  7. Use quotes for exact phrases (optional). If you need to match a string containing spaces or special characters, wrap it in double quotes, e.g. "example.com:8080". For host:port this is rarely necessary, but it helps when the hostname is part of a longer path.
  8. Combine with built-in filters. Click the filter-type buttons (All, Fetch/XHR, JS, CSS, Img, Media, Font, Doc, WS, Wasm, Other) to restrict by resource type. For example, select Fetch/XHR and type api.example.com:443 to see only API calls to that host and port.
  9. Use negative filters. Prefix a term with a minus sign to exclude it, e.g. -example.com hides all requests to that host. You can combine positive and negative terms: api.example.com:8080 -analytics.
  10. Inspect the filtered results. Click any request to see its Headers, Preview, Response, and Timing. The Headers tab shows the full request URL, including host and port, which confirms your filter is working.
  11. Clear the filter. Click the X in the filter field or select all and delete to return to the full list.

Common Mistakes

  • Forgetting to reload. The Network panel doesn't show past requests; if you open it after the page loaded, the list may be empty. Always reload or trigger the action again.
  • Typing the port without the host. A bare :8080 will match any URL containing that string, which may include unrelated requests. Include the host for precision.
  • Expecting a separate host/port dropdown. Chrome DevTools has no dedicated host/port filter UI; the text filter is the intended method. Don't waste time looking for a hidden setting.
  • Assuming the filter is case-sensitive. The Network filter is case-insensitive, so Example.com and example.com behave the same. This is usually helpful but can surprise you if you expect exact casing.
  • Using the wrong panel. The filter field exists in the Network panel, not the Console or Sources panel. Make sure you're in Network.

Tips

  • Preserve log. Enable "Preserve log" in the Network panel to keep requests across page navigations, so your filter stays useful when the page reloads or redirects.
  • Filter by status code. Type status-code:404 (or another code) in the filter box to show only responses with that status. Combine with a host filter: api.example.com status-code:500.
  • Filter by method. Use method:POST to show only POST requests, then add a host to narrow further.
  • Use the request blocking tab. If you need to block requests to a specific host:port, the Network panel's "Block request URL" option (available via right-click on a request or the Network conditions drawer) lets you add patterns. This is useful for testing failure scenarios.
  • Copy as cURL. Right-click a filtered request and choose Copy > Copy as cURL to reproduce it outside the browser, including the exact host and port.
  • Save your filter. Chrome remembers the last filter you typed per tab session, but not across browser restarts. For repeated debugging, keep a note of your common filters.

Troubleshooting

  • No requests appear at all. Check that the Network panel is open and recording (the red record button should be active). Reload the page. If you're on a page that uses a service worker, requests may be served from cache and not shown; disable cache in DevTools (checkbox in the Network panel) and reload.
  • The filter hides everything. Your term may be too specific. Try just the hostname without the port, or check for typos. Remember the match is substring-based, so a partial host like example should still show results.
  • Port numbers don't match what you expect. HTTPS requests default to port 443 and HTTP to port 80; the port may not appear in the URL if it's the default. If you're filtering for :443 and see nothing, try without the port โ€” the browser may omit it from the displayed URL even though the connection uses it.
  • Filter field is missing. In very old Chrome versions the filter was a simple text box; in current versions it's still there. If you truly don't see it, try widening the DevTools window or undocking it (the three-dot menu > Dock side).
  • Requests from iframes or workers don't show. By default, the Network panel shows requests from the main frame. Requests from service workers or iframes may appear under a different context; use the context dropdown (top-left of the Network panel) to switch to the relevant frame or worker.

Frequently Asked Questions

Can I filter by host and port using a dedicated setting?

No. Chrome DevTools has no separate host/port filter control. The text filter in the Network panel is the supported way; it matches against the full request URL, which includes host and port.

Does the filter support regular expressions?

Yes. Enable the "Use regular expression" toggle (the .* icon) next to the filter field, then enter a pattern such as ^https?://api\.example\.com:8080/ to match exactly. Without the toggle, the filter is a plain substring match.

Why does my host:port filter show requests to other ports?

Because the filter is a substring match, example.com:80 will also match example.com:8080. To avoid this, use a regular expression with word boundaries or include a trailing slash, e.g. example.com:80/.

Can I filter by host and port in the Console panel?

No. The Console panel has its own text filter for log messages, not network requests. Use the Network panel for request filtering.

Is there a way to see only requests to a specific IP address and port?

Yes, if the request URL contains the IP (for example, when connecting directly by IP). Type the IP and port in the filter field, e.g. 192.168.1.10:3000. If the site uses a hostname that resolves to that IP, the filter won't match because it works on the URL text, not the resolved address.

Does the filter work in Chrome on Android?

No. DevTools on mobile Chrome is limited; the full Network panel with filtering is available only on desktop Chrome. For mobile debugging, use remote debugging via desktop Chrome.