A per-app network connection monitor for macOS. Uses proc_pidfdinfo to track all TCP/UDP remote IPs of a target app and its entire process tree in real time, outputting a deduplicated address list — ideal for building firewall whitelists.
- Monitor the full process tree of a target app (including all child processes)
- Aggregate IPv4 addresses into /24 subnets; keep full IPv6 addresses
- Automatic deduplication — only newly discovered addresses are reported
- TUI interactive mode: browse installed apps, filter, and view live monitoring results
- CLI mode: plain text output, pipe-friendly for files or other commands
- Monitor apps that haven't started yet — collection begins automatically on launch
- Preserve data after app exit, accumulate on restart
- One-key export to file (
E) or copy to clipboard (C) - Pause/resume monitoring per target (
P) - Toggle between masked (subnet) and raw IP display (
S) - Toggle sort order: discovery time or alphabetical (
O) - Persist discovered addresses across sessions (default
/tmp/.net-use-address-history.json, configurable via--data-file)
Requires Rust 1.85+ (edition 2024).
cargo install net-useOr build from source:
cargo build --releaseThe binary will be at target/release/net-use.
Root privileges are required to read process socket information.
sudo net-useLaunches an app selection screen where you can type to filter, then press Enter to start monitoring.
Keybindings:
J/K— Scroll address list down / upS— Toggle between masked (subnet) and raw IP viewO— Toggle sort order (discovery time / alphabetical)P— Pause / resume monitoringE— Export address list to fileC— Copy address list to clipboardEsc— Return to app selectionQ— Quit
# Monitor by Bundle ID
sudo net-use --bundle com.google.Chrome --no-tui
# Monitor by process name
sudo net-use --name curl --no-tui
# Monitor by PID
sudo net-use --pid 1234 --no-tui
# Save history to a custom file
sudo net-use --data-file ./my-history.json
# Output to file
sudo net-use --bundle com.google.Chrome --no-tui > chrome-ips.txtExample output:
142.250.80.0/24
172.217.14.0/24
2607:f8b0:4004:800::200e
- Locate the target process via
proc_listallpidsandproc_pidpath - Recursively discover the full child process tree via
proc_listchildpids - Poll every 200ms, enumerating all socket file descriptors with
proc_pidfdinfo(PROC_PIDFDSOCKETINFO) - Extract remote IP addresses, filter out loopback and link-local, deduplicate, and output
- macOS only
- Requires root privileges (
sudo) - Very short-lived connections may be missed at the 200ms polling interval
- XPC services launched via launchd may not appear in the process tree
MIT