Detect interfaces per platform; add macOS and single-interface support (closes #2)
check / check (push) Failing after 0s

Linux runs exactly as before when both bridge interfaces exist. When they do
not, the lone default-route interface is monitored, and a single interface
draws a single UI pane instead of an empty second one.

macOS is newly supported: a running VPN tunnel (utun) is monitored as the
primary pane alongside the physical default-route interface, or the physical
interface alone when no VPN is up.

Detection lives in internal/netdetect: interface/route data types, pure
selection logic keyed on OS name, and route parsers, all unit-tested on Linux
for both platforms. Only the real route query and the per-platform TCP dial
binding are build-tagged. NewMonitor now takes a list of interfaces.

Not verified on a real mac: live netstat parsing, IP_BOUND_IF dialing, Mullvad leak protection.

Model: opus-4-8 (implementation); fable-5-1 (landing commit)
This commit was merged in pull request #4.
This commit is contained in:
2026-09-21 15:01:59 +02:00
parent 7dd4ac798d
commit 486a47397c
21 changed files with 1092 additions and 93 deletions
+1 -1
View File
@@ -6,6 +6,7 @@ require (
github.com/gdamore/tcell/v2 v2.8.1
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.2
golang.org/x/sys v0.29.0
)
require (
@@ -29,7 +30,6 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/term v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect