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

# How to debug network targets with Inspect

> Debug Chrome, Node.js, Electron, and other CDP-compatible applications over the network

Inspect can connect to any application that exposes the Chrome DevTools Protocol (CDP) over the network. This includes Chrome, Chromium-based browsers, Node.js, Electron, and other CDP-compatible runtimes.

## Enabling Network Targets

1. Go to **View → Devices → Enable Network Targets**
2. Network targets will appear in the sidebar under "Network Targets"

By default, Inspect connects to `localhost:9222`.

## Configuring Endpoints

You can configure custom endpoints by editing your Inspect config file:

| Platform | Config file location                 |
| -------- | ------------------------------------ |
| macOS    | `~/.inspect/config.json`             |
| Windows  | `%USERPROFILE%\.inspect\config.json` |

Add your endpoints to the config file:

```json theme={null}
{
  "devices": {
    "enableNetworkTargets": true,
    "networkTargets": [
      "localhost:9222",
      "192.168.1.100:9222",
      "my-server.local:9229"
    ]
  }
}
```

## Starting Debug Targets

### Chrome / Chromium

Start Chrome with remote debugging enabled:

```bash theme={null}
# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

# Windows
chrome.exe --remote-debugging-port=9222

# Linux
google-chrome --remote-debugging-port=9222
```

### Node.js

Start your Node.js application with the inspector:

```bash theme={null}
node --inspect=9229 app.js
```

To break on the first line of your application:

```bash theme={null}
node --inspect-brk=9229 app.js
```

### Electron

Start your Electron app with remote debugging:

```bash theme={null}
electron --remote-debugging-port=9222 .
```

## Context Menu Options

Right-click on targets in the sidebar for additional options:

* **Reload** - Refresh the active page
* **Bring to focus** - Activate the tab in the browser
* **Close tab** - Close the browser tab
* **Open new tab** - Open a new tab (right-click on the app name)

## Troubleshooting

### Target not appearing?

* Verify the application is running with debugging enabled
* Check the port number matches your config
* Ensure no firewall is blocking the connection

### Connection refused?

The debug port may be bound to localhost only. For remote debugging, start Chrome with:

```bash theme={null}
chrome.exe --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0
```

<Info>
  Binding to `0.0.0.0` exposes the debug port to your network. Only do this on trusted networks.
</Info>

### "Target already connected" error?

Only one debugger can connect to a target at a time. Close other DevTools windows or debuggers before connecting with Inspect.
