unarr/internal/engine
Deivid Soto 5f337eebd7 feat(agent): add WebSocket transport with HTTP fallback
Add Transport interface abstraction supporting WebSocket (via CF
Durable Objects) and HTTP (direct to origin) with automatic failover.

- Transport interface: Register, SendHeartbeat, SendProgress, Events()
- HTTPTransport: thin adapter over existing Client
- WSTransport: gorilla/websocket with auth handshake, readLoop, reconnect
- HybridTransport: tries WS first, falls back to HTTP, reconnects in bg
- Daemon refactored to always use Transport (no dual-path forks)
- ProgressReporter accepts StatusReporter interface
- deriveWSURL skips localhost/dev (returns "" → HTTP-only)
- API key passed in WS query param for connection auth
- Fixed: reconnectOnce race (mutex+bool), authDone double-close (sync.Once)
- Fixed: forwardWSEvents goroutine leak (select with stop signal)
- 20 transport tests + 2 E2E tests (full lifecycle, hybrid failover)
2026-03-28 18:55:29 +01:00
..
debrid.go feat(debrid): add HTTPS downloader for debrid direct URLs 2026-03-28 18:09:34 +01:00
debrid_test.go feat(debrid): add HTTPS downloader for debrid direct URLs 2026-03-28 18:09:34 +01:00
manager.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
manager_test.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
method.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
notify.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
organize.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
organize_test.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
progress.go feat(agent): add WebSocket transport with HTTP fallback 2026-03-28 18:55:29 +01:00
resolve.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
resolve_test.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
safepath.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
safepath_test.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
stream.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
stream_player.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
stream_server.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
stream_test.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
task.go feat(debrid): add HTTPS downloader for debrid direct URLs 2026-03-28 18:09:34 +01:00
task_test.go feat(debrid): add HTTPS downloader for debrid direct URLs 2026-03-28 18:09:34 +01:00
torrent.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
usenet.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
verify.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
verify_test.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00