Community Maintained: This crate is community-maintained and may have different stability guarantees than core IronRDP crates.
Overview
ironrdp-server provides an extendable, high-level skeleton for implementing custom RDP servers. It handles connection acceptance, capability negotiation, display updates, input events, and virtual channels through simple trait-based interfaces.
Key Features:
- Complete RDP server implementation with minimal boilerplate
- Type-safe builder pattern for configuration
- Trait-based handlers for input and display
- Support for static and dynamic virtual channels
- Built-in support for clipboard, audio, and display control
- Optional EGFX (Graphics Pipeline Extension) support
- Deactivation-reactivation for dynamic resizing
Installation
Features
default: Enablesrayon,qoi, andqoizrayon: Parallel encoding with Rayonqoi: QOI image codec supportqoiz: QOIZ compressed image codec supportegfx: Graphics Pipeline Extension (H.264 video streaming)helper: TLS helper utilities for certificate loading
Quick Start
Architecture
Builder Pattern
The server uses a type-state builder pattern to ensure correct configuration:Security Options
No Security (RDP)
TLS Only
Hybrid (CredSSP + TLS)
Input Handling
ImplementRdpServerInputHandler to receive input events:
Mouse Event Types
The server supports multiple mouse input modes:- Absolute positioning:
MouseEvent::Move { x, y } - Relative movement:
MouseEvent::RelMove { x, y } - Button events:
LeftPressed,RightPressed,MiddlePressed,Button4/5Pressed - Scroll events:
VerticalScroll { value },Scroll { x, y }
Display Management
Display Handler
ImplementRdpServerDisplay to provide display updates:
Sending Bitmap Updates
Supported Pixel Formats
- BgrA32: 32-bit BGRA (recommended)
- ABgr32: 32-bit ABGR
- RgbA32: 32-bit RGBA
- ARgb32: 32-bit ARGB
- Bgr24: 24-bit BGR
- Rgb24: 24-bit RGB
- Bgr16: 16-bit BGR565
- Rgb16: 16-bit RGB565
Display Updates
Supported update types:Dynamic Resizing
Custom Pointers
Bitmap Encoding
The server supports multiple bitmap codecs:Built-in Codecs
Codec Selection
- RemoteFX: Hardware-accelerated codec, efficient for large updates
- RDP 6.0: Standard compression (always available)
- QOI: Fast lossless codec (requires
qoifeature) - QOIZ: Compressed QOI (requires
qoizfeature)
Encoder Configuration
max_request_size controls the maximum size of fragmented updates. Default is 8 MB. Values too large may cause clients to reject connections.
Virtual Channels
Clipboard Support
Audio Support
Sending Audio Data
Display Control
The server automatically supports the Display Control channel (MS-RDPEDISP) for dynamic resolution changes initiated by the client:
EGFX (Graphics Pipeline Extension)
Echo Channel (RTT Measurement)
Measure round-trip time using the ECHO dynamic virtual channel:Complete Example
See the server example in the IronRDP repository for a complete working server implementation including:- Random bitmap generation
- Stub clipboard implementation
- Audio synthesis (sine wave)
- TLS configuration
- Credential validation
- Full input handling
Configuration Options
RdpServerOptions
Credentials
TLS Helper (Feature: helper)
Convenience utilities for TLS certificate handling:
Thread Safety
Handler traits requireSend but not Sync:
Arc<Mutex<>> for shared state. Blocking operations in handlers are spawned to tokio::task::spawn_blocking:
Performance Considerations
Encoding Performance
- Enable
rayonfeature for parallel encoding (default) - Use RemoteFX or QOI for better compression
- Adjust
max_request_sizebased on network conditions
Display Updates
- Send updates at reasonable rates (30-60 FPS max)
- Use sub-region updates when possible
- Consider framebuffer diffing to send only changes
Memory Usage
- Bitmap updates hold pixel data in
Bytes(reference-counted) - The server maintains a framebuffer for differencing
- Audio buffers are transient
Related Crates
ironrdp-acceptor- Low-level connection acceptanceironrdp-pdu- RDP PDU encoding/decodingironrdp-graphics- Image processing and codecsironrdp-cliprdr- Clipboard redirectionironrdp-rdpsnd- Audio redirectionironrdp-displaycontrol- Display control channelironrdp-egfx- Graphics pipeline extension
See Also
- Server Example - Complete working server
- RDP Server Architecture - Microsoft documentation

