ntrip-core
An async NTRIP client library for Rust.
Features
- Protocol Support: NTRIP v1 (ICY) and v2 (HTTP/1.1 chunked)
- Security: TLS/HTTPS via rustls (no OpenSSL dependency)
- Discovery: Sourcetable retrieval and nearest mountpoint selection
- Async: Built on Tokio for efficient async I/O
- Robust: Read timeouts, automatic reconnection (configurable), proper error handling
Quick Start
use ;
async
Automatic Reconnection
By default, the client will automatically attempt to reconnect up to 3 times on connection loss or timeout:
// Default: 3 reconnection attempts with 1 second delay
let config = new;
// Custom reconnection settings
let config = new
.with_reconnect; // 5 attempts, 2 second delay
// Disable automatic reconnection
let config = new
.without_reconnect;
When reconnection occurs, the client automatically resends the last GGA position to maintain VRS/nearest-base selection.
TLS/HTTPS Connections
TLS capability is always compiled in (via tokio-rustls). To connect to a TLS-enabled caster:
let config = new
.with_tls // Enable TLS for this connection
.with_credentials;
By default, connections use plain TCP. Call .with_tls() to enable TLS.
Sourcetable Discovery
use ;
let config = new;
let table = get_sourcetable.await?;
// Find nearest mountpoint
if let Some = table.nearest_rtcm_stream
Examples
# Fetch sourcetable from a caster
# Find nearest mountpoint to a location
# Connect and stream RTCM data
Testing
# Run unit tests
# Run comprehensive test suite against real casters
For connection tests, copy scripts/credentials.env.template to scripts/credentials.env and fill in your credentials.
Development
We use Just as a command runner:
Minimum Supported Rust Version
MSRV is 1.75.
License
Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)