Release builds use -tags production and strip symbols (-s -w). For Go profiling, stack traces, and frontend WebView debugging, build without the production tag:
go build -o build/conduit-debug.exe .
go build -o build/conduit-updater.exe ./cmd/conduit-updaterProduction build (no DevTools, no remote debugging port):
go build -tags production -o build/conduit.exe .| Flag | Description |
|---|---|
-debug |
slog level Debug; enables WebView DevTools and --remote-debugging-port=9222 |
-debug-inspector |
Auto-open inspector on the YouTube window at startup (requires -debug, non-production build) |
-pprof=:6060 |
HTTP pprof on 127.0.0.1:6060 (localhost only) |
-memprofile=heap.out |
Write heap profile on exit |
-no-gui |
Proxy only (best for soak / load tests) |
Example (backend only):
.\build\conduit-debug.exe -no-gui -pprof=:6060 -debugExample (GUI with frontend debug):
.\build\conduit-debug.exe -debug
# optional: auto-open inspector on YouTube
.\build\conduit-debug.exe -debug -debug-inspectorLogs with -debug go to %LocalAppData%\Conduit\logs\.
Conduit has no separate React/Vue bundle. The UI is four WebView2 windows (Wails v3):
| Window | Source | Notes |
|---|---|---|
| Splash | internal/app/ui/splash.html |
Shown ~1s at startup |
| Loading placeholder | internal/app/ui/loading.html |
Dark screen while YouTube preloads hidden |
| Onboarding | internal/app/ui/onboarding.html |
AllowSimpleEventEmit: true for onboarding:finish / onboarding:skip |
| YouTube | https://m.youtube.com |
Main window; traffic via local CONNECT proxy |
- YouTube window starts hidden with
loading.html. - On first
WebViewNavigationCompleted,SetURL(m.youtube.com). - On second navigation complete,
youtubeReadycloses. - Splash waits for
SplashDuration+youtubeReady(20s timeout), then shows YouTube or onboarding.
With -debug, navigation milestones are logged at slog.Debug (placeholder ready, YouTube ready, splash close).
When -debug is set (non-production build):
DevToolsEnabled: trueon splash, onboarding, and YouTube windows.--remote-debugging-port=9222is added to Chromium args (localhost only).- Tray menu adds Developer tools (
OpenDevTools) and Reload YouTube.
Attach from Chrome/Edge: open chrome://inspect → Remote Target → pick a Conduit WebView.
-debug-inspector opens DevTools when the YouTube window is shown (not during hidden preload — WebView2 rejects inspector on hidden windows). Requires a non-production build.
Onboarding HTML emits:
onboarding:finish— complete tutorialonboarding:skip— skip (first run only marks complete when appropriate)
Handled in internal/app/startup.go via app.Event.On. AllowSimpleEventEmit is enabled only on onboarding (not on YouTube/loading) per Wails security guidance.
A. Startup (splash + loading + YouTube)
- Run
conduit-debug.exe -debugwith a clean%LocalAppData%\Conduitif testing first-run. - Confirm logs:
placeholder navigation completed→youtube navigation completedbeforeshowing youtube window. chrome://inspectshould list WebView targets.- Network tab on YouTube: requests to
m.youtube.comvia127.0.0.1:<proxy-port>.
B. Onboarding
- Clear
onboardingCompletein preferences or use first launch. - DevTools → Console:
window.wails.Eventsavailable. - Finish/skip buttons → debug logs
onboarding finished/onboarding skipped.
C. YouTube
- No long white screen after show (dark placeholder preloads first).
- Video playback through proxy; check Console for errors.
- Minimize to tray → restore without flash.
WebView2 memory is outside the Go heap — use Task Manager for GUI soak.
References: Wails v3 window options.
With -pprof=:6060 running:
go tool pprof -http=:8080 http://127.0.0.1:6060/debug/pprof/heap
go tool pprof -http=:8080 http://127.0.0.1:6060/debug/pprof/goroutineno-gui: run many CONNECT requests through the proxy; watch goroutine and heap for growth.
GUI: use YouTube 10–15 minutes, minimize to tray, quit; compare heap before/after. WebView2 native memory is not visible in Go heap — use Task Manager for GUI soak.
go test ./...
go test -race ./...go.uber.org/goleak guards proxy start/stop in internal/proxy.
| Symptom | Likely cause |
|---|---|
| Goroutine count grows | Tray/update loops before stop; stuck CONNECT relays |
| Heap grows (no-gui) | Unbounded DNS cache (fixed: cap 512 hosts) |
| Hung CONNECT | Missing idle timeout on tunneled connections |
| White screen on YouTube | Preload not finished before show; check debug nav logs |
| DevTools missing | Built with -tags production or run without -debug |