Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,15 @@ NOTE: it’s not yet clear if this crate is an API Boundary or an implementation

#### [`crates/ironrdp-client`](./crates/ironrdp-client)

Portable RDP client without GPU acceleration.
Reusable client engine library: holds the `Config`/`ConfigBuilder`, the `RdpClient` runtime,
input/output event types, and the WebSocket transport. Consumed by `ironrdp-viewer` and any
other embedder (e.g. a headless agent).

#### [`crates/ironrdp-viewer`](./crates/ironrdp-viewer)

Portable RDP client binary without GPU acceleration. A thin wrapper around `ironrdp-client`
that adds the winit/softbuffer GUI event loop, the clap CLI, the inquire prompts and the
`.rdp` file / PropertySet plumbing.

#### [`crates/ironrdp-web`](./crates/ironrdp-web)

Expand Down
45 changes: 29 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ Supported codecs:

## Examples

### [`ironrdp-client`](https://github.com/Devolutions/IronRDP/tree/master/crates/ironrdp-client)
### [`ironrdp-viewer`](https://github.com/Devolutions/IronRDP/tree/master/crates/ironrdp-viewer)

A full-fledged RDP client based on IronRDP crates suite, and implemented using non-blocking, asynchronous I/O.
It is built on top of the reusable [`ironrdp-client`](https://github.com/Devolutions/IronRDP/tree/master/crates/ironrdp-client) library crate.

```shell
cargo run --bin ironrdp-client -- <HOSTNAME> --username <USERNAME> --password <PASSWORD>
cargo run --bin ironrdp-viewer -- <HOSTNAME> --username <USERNAME> --password <PASSWORD>
```

### [`screenshot`](https://github.com/Devolutions/IronRDP/blob/master/crates/ironrdp/examples/screenshot.rs)
Expand Down
31 changes: 3 additions & 28 deletions crates/ironrdp-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
name = "ironrdp-client"
version = "0.1.0"
readme = "README.md"
description = "Portable RDP client without GPU acceleration"
description = "Portable RDP client engine without GPU acceleration"
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true
keywords.workspace = true
categories.workspace = true
default-run = "ironrdp-client"

# Not publishing for now.
publish = false
Expand All @@ -19,10 +18,6 @@ publish = false
doctest = false
test = false

[[bin]]
name = "ironrdp-client"
test = false

[features]
default = ["rustls"]
rustls = ["ironrdp-tls/rustls", "tokio-tungstenite/rustls-tls-native-roots", "ironrdp-mstsgu/rustls"]
Expand All @@ -46,50 +41,30 @@ ironrdp = { path = "../ironrdp", version = "0.14", features = [
"echo",
] }
ironrdp-core = { path = "../ironrdp-core", version = "0.1", features = ["alloc"] }
ironrdp-cliprdr-native = { path = "../ironrdp-cliprdr-native", version = "0.5" }
ironrdp-rdpsnd-native = { path = "../ironrdp-rdpsnd-native", version = "0.5" }
ironrdp-tls = { path = "../ironrdp-tls", version = "0.2" }
ironrdp-mstsgu = { path = "../ironrdp-mstsgu" }
ironrdp-tokio = { path = "../ironrdp-tokio", version = "0.8", features = ["reqwest"] }
ironrdp-rdcleanpath.path = "../ironrdp-rdcleanpath"
ironrdp-dvc-pipe-proxy.path = "../ironrdp-dvc-pipe-proxy"
ironrdp-propertyset.path = "../ironrdp-propertyset"
ironrdp-rdpfile.path = "../ironrdp-rdpfile"
ironrdp-cfg.path = "../ironrdp-cfg"

# Windowing and rendering
winit = { version = "0.30", features = ["rwh_06"] }
softbuffer = "0.4"

# CLI
clap = { version = "4.6", features = ["derive", "cargo"] }
proc-exit = "2"
inquire = "0.9"

# Logging
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# Async, futures
tokio = { version = "1", features = ["full"] }
tokio = { version = "1", features = ["macros", "net", "io-util", "sync", "rt", "time"] }
tokio-util = { version = "0.7" }
tokio-tungstenite = "0.29"
transport = { git = "https://github.com/Devolutions/devolutions-gateway", rev = "06e91dfe82751a6502eaf74b6a99663f06f0236d" }
futures-util = { version = "0.3", features = ["sink"] }

# Utils
whoami = "2.1"
anyhow = "1"
smallvec = "1.15"
tap = "1"
semver = "1"
raw-window-handle = "0.6"
uuid = { version = ">=1.16, <1.21" } # Pinned below 1.21: see ironrdp-mstsgu/Cargo.toml for rationale.
x509-cert = { version = "0.2", default-features = false, features = ["std"] }
url = "2"
x509-cert = { version = "0.2", default-features = false, features = ["std"] }

[target.'cfg(windows)'.dependencies]
windows = { version = "0.62", features = ["Win32_Foundation"] }
ironrdp-dvc-com-plugin = { path = "../ironrdp-dvc-com-plugin" }

[lints]
Expand Down
84 changes: 9 additions & 75 deletions crates/ironrdp-client/README.md
Comment thread
CBenoit marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,84 +1,18 @@
# IronRDP client

Portable RDP client without GPU acceleration.
Reusable RDP client engine library built on top of the IronRDP crates suite.

This is a a full-fledged RDP client based on IronRDP crates suite, and implemented using
non-blocking, asynchronous I/O. Portability is achieved by using softbuffer for rendering
and winit for windowing.
This crate is **library-only**: it exposes the `Config`, the `RdpClient`
runtime, input/output event types, the WebSocket transport, and the session driver. It is
consumed by `ironrdp-viewer` (the portable GUI client binary) and by any other embedder
(for example, a headless agent).

## Sample usage
The library is winit-agnostic. Output events are emitted on a bounded
`tokio::sync::mpsc::Sender<RdpOutputEvent>` channel: the embedder is responsible
for consuming them and dispatching them to whatever event loop or runtime it wishes.

```shell
ironrdp-client <HOSTNAME> --username <USERNAME> --password <PASSWORD>
```

## `.rdp` file support

You can load a `.rdp` file with `--rdp-file <PATH>`.

Currently supported properties:

- `full address:s:<value>`
- `alternate full address:s:<value>`
- `server port:i:<value>`
- `username:s:<value>`
- `ClearTextPassword:s:<value>`
- `domain:s:<value>`
- `enablecredsspsupport:i:<0|1>`
- `gatewayhostname:s:<value>`
- `gatewayusagemethod:i:<value>`
- `gatewaycredentialssource:i:<value>`
- `gatewayusername:s:<value>`
- `GatewayPassword:s:<value>`
- `kdcproxyurl:s:<value>` (also `KDCProxyURL:s:<value>`)
- `kdcproxyname:s:<value>`
- `alternate shell:s:<value>`
- `shell working directory:s:<value>`
- `redirectclipboard:i:<0|1>`
- `audiomode:i:<0|1|2>`
- `desktopwidth:i:<value>`
- `desktopheight:i:<value>`
- `desktopscalefactor:i:<value>`
- `compression:i:<0|1>`

Property precedence is:

1. CLI options
2. `.rdp` file values
3. Defaults and interactive prompts

Unknown or unsupported `.rdp` properties are ignored and do not cause parsing failures. Parse
issues are reported to stderr.


The `IRONRDP_LOG` environment variable is used to set the log filter directives.

```shell
IRONRDP_LOG="info,ironrdp_connector=trace" ironrdp-client <HOSTNAME> --username <USERNAME> --password <PASSWORD>
```

See [`tracing-subscriber`’s documentation][tracing-doc] for more details.

[tracing-doc]: https://docs.rs/tracing-subscriber/0.3.17/tracing_subscriber/filter/struct.EnvFilter.html#directives

## Support for `SSLKEYLOGFILE`

This client supports reading the `SSLKEYLOGFILE` environment variable.
When set, the TLS encryption secrets for the session will be dumped to the file specified
by the environment variable.
This file can be read by Wireshark so that in can decrypt the packets.

### Example

```shell
SSLKEYLOGFILE=/tmp/tls-secrets ironrdp-client <HOSTNAME> --username <USERNAME> --password <PASSWORD>
```

### Usage in Wireshark

See this [awakecoding's repository][awakecoding-repository] explaining how to use the file in wireshark.
For the end-user RDP client binary, see [`ironrdp-viewer`](../ironrdp-viewer).

This crate is part of the [IronRDP] project.

[IronRDP]: https://github.com/Devolutions/IronRDP
[awakecoding-repository]: https://github.com/awakecoding/wireshark-rdp#sslkeylogfile
Loading
Loading