Skip to main content
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: Enables rayon, qoi, and qoiz
  • rayon: Parallel encoding with Rayon
  • qoi: QOI image codec support
  • qoiz: QOIZ compressed image codec support
  • egfx: 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

Implement RdpServerInputHandler 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

Implement RdpServerDisplay 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

The server automatically handles deactivation-reactivation sequences.

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 qoi feature)
  • QOIZ: Compressed QOI (requires qoiz feature)

Encoder Configuration

The 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

See the server example for a complete stub implementation.

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)

EGFX support is experimental and requires the egfx feature flag.
EGFX enables H.264 video streaming for efficient remote desktop scenarios.

Echo Channel (RTT Measurement)

Measure round-trip time using the ECHO dynamic virtual channel:
The echo handle can be cloned and used from any task. Requests are queued if the client hasn’t opened the ECHO channel yet.

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

If credentials are set, the server validates client credentials during CredSSP or in the Client Info PDU.

TLS Helper (Feature: helper)

Convenience utilities for TLS certificate handling:

Thread Safety

Handler traits require Send but not Sync:
The server internally uses Arc<Mutex<>> for shared state. Blocking operations in handlers are spawned to tokio::task::spawn_blocking:

Performance Considerations

Encoding Performance

  • Enable rayon feature for parallel encoding (default)
  • Use RemoteFX or QOI for better compression
  • Adjust max_request_size based 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

See Also