wraith/internal/rdp/freerdp_factory.go
Vantz Stockwell a8974da37d feat: FreeRDP3 purego backend for Windows with platform stub
Add the real FreeRDP3 RDP backend that loads libfreerdp3.dll at runtime
via syscall.NewLazyDLL (no CGO required). The Windows implementation
(freerdp_windows.go) calls FreeRDP3 functions for instance lifecycle,
settings configuration, input forwarding, and event handling. A stub
(freerdp_stub.go) compiles on non-Windows platforms and returns errors,
keeping macOS/Linux development and tests working. A factory function
(freerdp_factory.go) selects the right backend based on runtime.GOOS,
and app.go now uses NewProductionBackend instead of always using mock.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 07:43:31 -04:00

15 lines
463 B
Go

package rdp
import "runtime"
// NewProductionBackend returns the appropriate RDP backend for the current
// platform. On Windows it returns a FreeRDPBackend that loads freerdp3.dll
// at runtime via syscall. On other platforms it falls back to MockBackend
// so the application can still be developed and tested without FreeRDP.
func NewProductionBackend() RDPBackend {
if runtime.GOOS == "windows" {
return NewFreeRDPBackend()
}
return NewMockBackend()
}