This project compiles Marc-André Moreau's IronRDP Web client to WebAssembly (WASM) for use in web projects. It provides a JavaScript module that can be imported into web applications to enable RDP connectivity.
- ironrdp-wasm is a WebAssembly build of the IronRDP library, specifically the
ironrdp-webcrate created by Marc-André Moreau. - This package simply compiles the existing IronRDP Rust code to WebAssembly - all credit for the RDP implementation goes to the original IronRDP project.
- It allows web applications to connect to RDP servers directly from the browser.
- Combined with
lib/rdp-proxy.js(now in the example folder), it provides a complete RDP client solution for web.
npm install ironrdp-wasmimport { init, SessionBuilder } from 'ironrdp-wasm';
// Initialize the WASM module
await init();
// Create a session
const session = new SessionBuilder()
.withUsername('user')
.withPassword('pass')
.withDomain('domain')
.withHost('rdp-server.example.com')
.build();
// Connect
await session.connect();Before building this project, ensure you have the following installed:
Install Rust using rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shAdd the WebAssembly target:
rustup target add wasm32-unknown-unknownInstall wasm-pack for building Rust-generated WebAssembly packages:
cargo install wasm-packInstall Node.js (version 16 or later) from nodejs.org or using a version manager like nvm.
To build the WASM module from source:
-
Clone the repository:
git clone https://github.com/electerm/ironrdp-wasm.git cd ironrdp-wasm -
Install dependencies:
npm install
-
Build the WASM module:
npm run build
This command runs wasm-pack build --target web --out-dir pkg --release, which:
- Compiles the Rust code in
src/lib.rsto WebAssembly - Generates JavaScript bindings in the
pkg/directory - Optimizes the WASM binary for production
The build output will be in the pkg/ folder, containing:
rdp_client.js- JavaScript bindingsrdp_client_bg.wasm- The compiled WebAssembly modulerdp_client.d.ts- TypeScript definitions
For development builds (with debug symbols):
wasm-pack build --target web --out-dir pkg --devTo clean the build:
rm -rf pkg/See the example/ folder for a complete demo application that includes:
- A web-based RDP client UI (
index.html) - A WebSocket proxy server (
server.js) for handling RDP connections - Proxy utilities (
lib/rdp-proxy.js)
To run the example:
-
Install example dependencies:
cd example npm install cd ..
-
Build the WASM module (if not already built):
npm run build
-
Start the example server:
npm run example
Then open http://localhost:8080 in your browser.
The module exports all functions and classes from the IronRDP Web API. Refer to the IronRDP documentation for detailed API reference.
This package is a WebAssembly compilation of Marc-André Moreau's IronRDP library. All RDP protocol implementation and core functionality is from the original IronRDP project. This package simply provides the build tooling and JavaScript bindings to make IronRDP available for web projects.
MIT