The TCP connection (handled by Golang) is abstracted into a
IpnRawTcpChannelon JS side. It implements theRTCDataChannelinterface to allow use with NoVNC & IronRDP but has nothing to do with WebRTC.
Authentication via the IdP can occur in a new tab or on a separate device, but the original tab must remain open at all times to receive the authorization callback.
sequenceDiagram
Participant user as User
Participant js as JavaScript
Participant go as Go WASM
Participant headscale as Headscale
Participant idp as Identity Provider
user->>js: Opens tab
js->>go: Start client
go->>js: Notifies: NeedsLogin
js->>go: Calls login()
go->>headscale: Request authorization URL
headscale->>go: Provides unique URL
go->>js: Notifies: browseToURL
js->>user: Display URL (Link/QR)
rect rgba(255,255,255,0.1)
user->>idp: Opens link / Scans QR
Note over user,idp: New tab or device
idp->>headscale: user authenticates and authorizes device
end
headscale->>go: Notifies: Authorized
go->>js: Notifies: Running
js->>user: Render UI
Go handles the full protocol stack. JavaScript (xterm) handles rendering.
sequenceDiagram
Participant derp as DERP
Participant go as Go WASM
Participant js as JavaScript
Participant dom as DOM
derp ->> go: WebSocket
go ->> js: Text
js ->> dom: Render
js -->> go: Input
go -->> derp: WebSocket
Go handles the TCP layer. JavaScript (NoVNC) manages the VNC protocol.
sequenceDiagram
Participant derp as DERP
Participant go as Go WASM
Participant js as JavaScript
Participant dom as DOM
derp ->> go: WebSocket
go ->> js: TCP data
js ->> dom: Render
js -->> go: TCP data
go -->> derp: WebSocket
Go handles the TCP layer. JavaScript passes packets to the Rust-based WASM module (IronRDP), which handles TLS, RDP, and rendering.
sequenceDiagram
Participant derp as DERP
Participant go as Go WASM
Participant js as JavaScript
Participant rust as Rust WASM
Participant dom as DOM
derp ->> go: WebSocket
go ->> js: TCP data
js ->> rust: TCP data
rust ->> dom: Render
js -->> rust: UI events
rust -->> js: TCP data
js -->> go: TCP data
go -->> derp: WebSocket