WebSocket Timeout and IronError with Undefined Details in ironrdp-web When Connecting to RDP Server
I am encountering an issue with the ironrdp-web module when attempting to establish an RDP connection to a Windows Server 2022 RDP server using the WebAssembly (WASM) client. The connection process consistently fails with a WebSocket timeout after approximately 2 minutes, followed by an IronError with undefined kind and backtrace details.
Steps to Reproduce
Setup:
Environment: Windows Server 2022 (RDP server at
IronRDP WASM module loaded. SessionBuilder configuration completed: SessionBuilder {__wbg_ptr: 1770504} After approximately 2 minutes, the following errors appear: text
WebSocket connection to 'ws://
Proxy
loop {
match ws.state() {
websocket::State::Connecting => {
trace!("WebSocket is connecting to proxy at {proxy_address}...");
gloo_timers::future::sleep(Duration::from_millis(50)).await;
}
...
}
}
The IronError lacks kind and backtrace details, indicating a potential issue with wasm_bindgen bindings for the IronError struct.
The ECONNRESET error in the proxy suggests the RDP server (Windows Server 2022) is rejecting the connection, possibly due to:
Incorrect credentials (
ironrdp-web/Cargo.toml
[dependencies] wasm-bindgen = "0.2.87" ...
IronRDP/Cargo.toml
[workspace.dependencies] wasm-bindgen = "0.2.87" cargo tree (partial): text
├── wasm-bindgen v0.2.100 ├── wasm-bindgen-futures v0.4.50 ... Request Could you please provide guidance on debugging the WebSocket timeout and IronError issues? Specifically, any insights into the connect method’s behavior, IronError binding issues, or server configuration requirements would be greatly appreciated. I can provide additional logs or test specific scenarios if needed.
Thank you for your support!
Hello!
It seems you are using a Node.js WebSocket-to-TCP proxy? Unfortunately, you can’t use just any WebSocket-to-TCP proxy.
For the web client to work, we created a small extension called the RDCleanPath. The client is sending a preconnection packet, the RDCleanPath request, that is intercepted and interpreted by the proxy. Using this packet, the proxy performs a TLS connection with the target server and returns a response including the target server TLS certificate, required to perform the authentication in a safe way. At this point the usual RDP protocol stuff start.
You could use the Devolutions Gateway as a RDCleanPath-aware proxy. You can read more here: https://github.com/Devolutions/IronRDP/tree/ff798c91a743b4e7b132462ffc40c6f0a8e56162/web-client/iron-svelte-client#requirements
PS: Please, it would be much easier to read with proper formatting.
Hi - as my colleague @CBenoit said, you need the RDCleanPath extension that adapts RDP to WSS for the web, you can't just use a regular WSS to TCP or TLS bridge. Devolutions Gateway implements the RDCleanPath extension here: https://github.com/Devolutions/devolutions-gateway/blob/master/devolutions-gateway/src/rdp_extension.rs