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
85 changes: 85 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,91 @@ All notable changes to rustvncserver will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2025-10-27

**Stable Release** - This marks the official 2.0.0 release, graduating from beta status.

### Changed

- **Code Deduplication**: Removed duplicate code to improve maintainability
- Updated `rfb-encodings` dependency from `0.1.3` to `0.1.5`
- Removed duplicate encoding type constants from `protocol.rs` (now imported from `rfb-encodings`)
- Removed duplicate Hextile and Tight subencoding constants (now imported from `rfb-encodings`)
- Deleted duplicate `src/jpeg/` module (now using TurboJPEG from `rfb-encodings`)
- Encoding constants now have single source of truth in `rfb-encodings` library
- Server-specific constants (COPYRECT, pseudo-encodings, protocol messages) remain in `protocol.rs`
- Code reduction: ~220 lines of duplicate code eliminated

- **Documentation**: Comprehensive TurboJPEG setup and licensing information
- Added TurboJPEG installation instructions for Ubuntu/Debian, macOS, and Windows in README
- Added "TurboJPEG Setup" section with platform-specific installation commands
- Updated License section to document optional third-party dependencies
- Updated NOTICE file with complete libjpeg-turbo attribution including:
- BSD-3-Clause license for TurboJPEG API
- IJG License for libjpeg code
- zlib License for SIMD extensions
- Copyright notices for all contributors
- Clarified that libjpeg-turbo is NOT distributed and users are responsible for license compliance

### Improved

- Simplified API surface by consolidating constant definitions
- Better separation of concerns: encoding library handles encoding constants, server handles protocol constants
- Reduced maintenance burden by eliminating duplicate code across projects

## [2.0.0-beta.4] - 2025-10-25

### Changed

- Updated all documentation (README.md, TECHNICAL.md, CONTRIBUTING.md) to properly credit the `rfb-encodings` library
- Added clear references to [rfb-encodings](https://github.com/dustinmcafee/rfb-encodings) throughout documentation
- Updated architecture diagrams to show the separation between rustvncserver and rfb-encodings
- Clarified that rfb-encodings provides encoding implementations (for servers), not decoding (for clients)
- Updated version examples in documentation to use version 2.0

## [2.0.0-beta.3] - 2025-10-23

### Changed

- Updated `rfb-encodings` dependency from `0.1` to `0.1.3`
- Fixes critical build failure when using `turbojpeg` feature without `debug-logging`
- Resolves "use of unresolved module or unlinked crate log" compilation errors
- All turbojpeg builds now work correctly

## [2.0.0-beta.2] - 2025-10-23

### Fixed

- Code formatting: Removed extra blank line in `protocol.rs`

## [2.0.0-beta.1] - 2025-10-23

### Changed

- **Major architectural refactoring:** Extracted all encoding implementations to separate `rfb-encodings` crate
- All encoding modules (Raw, RRE, CoRRE, Hextile, Zlib, Tight, TightPng, ZlibHex, ZRLE, ZYWRLE) moved to `rfb-encodings`
- Pixel format translation moved to `rfb-encodings`
- `PixelFormat` struct now re-exported from `rfb-encodings`
- Benefits:
- Encoding implementations now reusable across VNC servers, clients, proxies, and recorders
- Cleaner separation of concerns: protocol vs encoding
- Independent versioning and publishing of encodings
- Better visibility and discoverability on crates.io
- **Fully backwards compatible:** All public APIs preserved through re-exports
- Existing code using `rustvncserver::encoding::*` or `rustvncserver::PixelFormat` continues to work

### Added

- New dependency: `rfb-encodings` crate (0.1.2) for all encoding implementations
- Re-exported all encoding types from `rfb-encodings` for full backwards compatibility
- `pub use rfb_encodings as encoding;` allows seamless access to all encodings

### Fixed

- All fixes from rfb-encodings 0.1.1 and 0.1.2 inherited:
- macOS CI Build: Fixed turbojpeg linking errors
- Compiler warnings for conditional compilation suppressed

## [1.1.5] - 2025-10-23

### Fixed
Expand Down
21 changes: 16 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ We welcome feature suggestions! Please create an issue with:
- Rust 1.90 or later
- `libjpeg-turbo` (optional, for turbojpeg feature)

### Architecture

rustvncserver uses the separate [rfb-encodings](https://github.com/dustinmcafee/rfb-encodings) library for all encoding implementations. This modular design allows:
- Encoding code to be reused across VNC servers, proxies, and recording tools
- Independent versioning and publishing of encoding implementations
- Better separation of concerns (protocol vs encoding)

### Building

```bash
Expand Down Expand Up @@ -139,11 +146,15 @@ cargo test --all-features

If you're adding a new VNC encoding:

1. Create a new file in `src/encoding/`
2. Implement the encoding following RFC 6143 specification
3. Add comprehensive tests
4. Update README.md with the new encoding
5. Add example demonstrating the encoding
1. Contribute to the [rfb-encodings](https://github.com/dustinmcafee/rfb-encodings) library instead
2. Create a new file in the rfb-encodings `src/` directory
3. Implement the encoding following RFC 6143 specification
4. Add comprehensive tests
5. Update the rfb-encodings README.md with the new encoding
6. Update rustvncserver to use the new encoding from rfb-encodings
7. Add example demonstrating the encoding in rustvncserver

**Note:** All encoding implementations are now maintained in the separate rfb-encodings crate for reusability across VNC servers and other tools.

## Performance Considerations

Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustvncserver"
version = "1.1.5"
version = "2.0.0"
edition = "2021"
rust-version = "1.90"
authors = ["Dustin McAfee"]
Expand All @@ -17,17 +17,17 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
tokio = { version = "1", features = ["rt-multi-thread", "sync", "time", "net", "io-util", "macros"] }
bytes = "1"
flate2 = "1.0" # Zlib compression
png = "0.17" # PNG encoding for TightPng
log = "0.4"
thiserror = "1.0" # Error handling
des = "0.8" # DES encryption for VNC auth
rand = "0.8" # Random number generation for auth
flate2 = "1.0" # Zlib compression for Tight encoding
rfb-encodings = "0.1.5" # RFB encoding implementations

[features]
default = []
turbojpeg = [] # Enable TurboJPEG for better JPEG performance (requires libjpeg-turbo)
debug-logging = [] # Enable verbose debug logging (shows client IPs, connection details)
turbojpeg = ["rfb-encodings/turbojpeg"] # Enable TurboJPEG for better JPEG performance (requires libjpeg-turbo)
debug-logging = ["rfb-encodings/debug-logging"] # Enable verbose debug logging (shows client IPs, connection details)

[dev-dependencies]
tokio-test = "0.4"
Expand Down
22 changes: 22 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,28 @@ non-commercial applications.

================================================================================

TurboJPEG / libjpeg-turbo (Optional):

When compiled with the 'turbojpeg' feature flag, this software provides FFI
bindings to libjpeg-turbo, which must be installed separately by the end user.

libjpeg-turbo is licensed under a BSD-style license with multiple components:
- libjpeg-turbo API: BSD 3-Clause License
- libjpeg code: Independent JPEG Group (IJG) License
- SIMD extensions: zlib License

Copyright (C) 2009-2024 D. R. Commander
Copyright (C) 2015, 2020 Google, Inc.
Portions Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding

libjpeg-turbo is NOT distributed with this software. Users must install it
separately and are responsible for compliance with its license terms.

For full license text, see:
https://github.com/libjpeg-turbo/libjpeg-turbo/blob/main/LICENSE.md

================================================================================

This software depends on the following third-party Rust crates:

- tokio (MIT License)
Expand Down
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ A pure Rust VNC (Virtual Network Computing) server library with complete RFB pro

### Supported Encodings

All encoding implementations are provided by the separate [**rfb-encodings**](https://github.com/dustinmcafee/rfb-encodings) library, which can be reused across VNC servers and recording/proxy tools that need to encode framebuffer data.

| Encoding | ID | Description | Wire Format Match | Testing Status |
|----------|----|----|-------------------|----------------|
| **Raw** | 0 | Uncompressed pixels | ✅ 100% | ✅ Tested |
Expand Down Expand Up @@ -96,21 +98,38 @@ Add to your `Cargo.toml`:

```toml
[dependencies]
rustvncserver = "1.1"
rustvncserver = "2.0"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
```

### Optional Features

```toml
[dependencies]
rustvncserver = { version = "1.1", features = ["turbojpeg"] }
rustvncserver = { version = "2.0", features = ["turbojpeg"] }
```

**Features:**
- `turbojpeg` - Enable TurboJPEG for hardware-accelerated JPEG compression (requires libjpeg-turbo)
- `debug-logging` - Enable verbose debug logging (shows client IPs, connection details, encoding statistics)

### TurboJPEG Setup

The `turbojpeg` feature requires libjpeg-turbo to be installed on your system:

**Ubuntu/Debian:**
```bash
sudo apt-get install libturbojpeg0-dev
```

**macOS:**
```bash
brew install jpeg-turbo
```

**Windows:**
Download from [libjpeg-turbo.org](https://libjpeg-turbo.org/)

## Quick Start

```rust
Expand Down Expand Up @@ -355,10 +374,15 @@ This library implements the VNC protocol as specified in RFC 6143, which is a pu
The ZYWRLE algorithm is used under a BSD-style license from Hitachi Systems & Services, Ltd.
All Rust dependencies use MIT or dual MIT/Apache-2.0 licenses.

### Optional Third-Party Dependencies

When using the `turbojpeg` feature, this library provides bindings to libjpeg-turbo (licensed under BSD-3-Clause, IJG, and zlib licenses). Users are responsible for compliance with libjpeg-turbo's license terms. See [NOTICE](NOTICE) for details.

## Credits

- **Author**: Dustin McAfee
- **Protocol**: Implements RFC 6143 (RFB Protocol Specification)
- **Encodings**: [rfb-encodings](https://github.com/dustinmcafee/rfb-encodings) - Reusable RFB encoding library
- **Used in**: [RustVNC](https://github.com/dustinmcafee/RustVNC) - VNC server for Android

## See Also
Expand Down
28 changes: 23 additions & 5 deletions TECHNICAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ Complete technical documentation for the rustvncserver library and RFC 6143 prot

rustvncserver is a pure Rust VNC (Virtual Network Computing) server library with full RFC 6143 protocol compliance.

All encoding implementations are provided by the separate [**rfb-encodings**](https://github.com/dustinmcafee/rfb-encodings) library, which provides reusable RFB encoding modules for VNC servers and other tools that need to encode framebuffer data.

### Key Features

**Protocol Compliance:**
- ✅ RFC 6143 (RFB Protocol 3.8) fully compliant
- ✅ 11 encoding types implemented
- ✅ 11 encoding types implemented (via rfb-encodings library)
- ✅ All standard pixel formats (8/16/24/32-bit)
- ✅ Quality and compression level pseudo-encodings
- ✅ Reverse connections and repeater support
Expand All @@ -36,6 +38,7 @@ rustvncserver is a pure Rust VNC (Virtual Network Computing) server library with
- **Thread Safety**: No data races, safe concurrent client handling
- **Modern Async I/O**: Built on Tokio runtime for efficient connection handling
- **Better Performance**: Zero-copy framebuffer updates via Arc-based sharing
- **Modular Design**: Encoding implementations separated into reusable rfb-encodings crate

### Architecture

Expand All @@ -50,10 +53,17 @@ rustvncserver is a pure Rust VNC (Virtual Network Computing) server library with
│ └──────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────┐ │
│ │ VncClient (per-client connection) │ │
│ │ • Pixel format translation │ │
│ │ • Encoding selection │ │
│ │ • Compression streams │ │
│ └──────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
▼ uses
┌─────────────────────────────────────────────────┐
│ rfb-encodings Library │
│ ┌──────────────────────────────────────────┐ │
│ │ Pixel format translation │ │
│ └──────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────┐ │
│ │ Encodings (11 types) │ │
│ │ • Tight (5 modes) + libjpeg-turbo │ │
Expand Down Expand Up @@ -686,16 +696,17 @@ The library depends on the following crates (from `Cargo.toml`):

```toml
[dependencies]
rfb-encodings = "0.1" # RFB encoding implementations
tokio = { version = "1", features = ["rt-multi-thread", "sync", "time", "net", "io-util", "macros"] }
bytes = "1"
flate2 = "1.0" # Zlib compression
png = "0.17" # PNG encoding for TightPng
log = "0.4"
thiserror = "1.0" # Error handling
des = "0.8" # DES encryption for VNC auth
rand = "0.8" # Random number generation
```

**Note:** All encoding-related dependencies (flate2, png, libjpeg-turbo, etc.) are now managed by the rfb-encodings crate.

### Optional Features

The library supports optional compilation features:
Expand All @@ -708,11 +719,18 @@ The library can be integrated into any Rust project by adding to `Cargo.toml`:

```toml
[dependencies]
rustvncserver = "1.0"
rustvncserver = "2.0"
# Or from a git repository:
# rustvncserver = { git = "https://github.com/dustinmcafee/rustvncserver" }
```

The rfb-encodings library is included automatically as a dependency. If you need to use encoding functions directly, you can also add:

```toml
[dependencies]
rfb-encodings = "0.1"
```

---

## API Reference
Expand Down
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use crate::protocol::{
PROTOCOL_VERSION, SECURITY_RESULT_FAILED, SECURITY_RESULT_OK, SECURITY_TYPE_NONE,
SECURITY_TYPE_VNC_AUTH, SERVER_MSG_FRAMEBUFFER_UPDATE, SERVER_MSG_SERVER_CUT_TEXT,
};
use crate::translate;
use rfb_encodings::translate;

/// Represents various events that a VNC client can send to the server.
/// These events typically correspond to user interactions like keyboard input,
Expand Down
Loading
Loading