Skip to main content
The server example demonstrates how to build a complete RDP server using the ironrdp-server crate. It implements a fully functional RDP server with audio output, clipboard redirection, and random graphics generation.

Overview

Location: crates/ironrdp/examples/server.rs Purpose: Demonstrate complete RDP server implementation Key Features:
  • Async I/O using tokio
  • TLS and Hybrid (CredSSP) security modes
  • Audio streaming with OPUS encoding
  • Clipboard redirection (stub implementation)
  • Keyboard and mouse input handling
  • Random colored bitmap generation

Usage

Basic Usage (No Security)

With TLS Certificate

With Logging

Command-Line Arguments

Code Walkthrough

1. Input Handler

Implements keyboard and mouse event handling:
See: server.rs:131

2. Display Handler

Provides desktop size and generates display updates:
See: server.rs:200

3. Display Updates

Generates random colored rectangles for demonstration:
See: server.rs:152

4. Clipboard Handler

Stub implementation for clipboard redirection:
See: server.rs:213

5. Audio Handler

Generates sine wave audio and sends it to the client:
See: server.rs:252

6. Sine Wave Generation

See: server.rs:363

7. Server Configuration

See: server.rs:394

Security Modes

TLS Mode

Standard TLS encryption without CredSSP:

Hybrid Mode

TLS with CredSSP for enhanced authentication:

No Security

For testing only (not recommended):

Testing the Server

Using Microsoft Remote Desktop

Using IronRDP Screenshot Example

Key Takeaways

  1. Async Runtime: Uses tokio for async I/O and task spawning
  2. Modular Design: Separate handlers for input, display, clipboard, and audio
  3. Event-Driven: Audio and display updates sent asynchronously via channels
  4. Flexible Security: Supports multiple security modes (none, TLS, hybrid)
  5. Extensible: Easy to add custom display rendering and input handling

Architecture Diagram

Further Reading