rtmp-runtime 0.13.0

Sans-IO RTMP 1.0 (Adobe Real-Time Messaging Protocol) publish engine for both ends: a driveable ingest server state machine and a publish client over the handshake, chunk stream, AMF0, and message layers; optional tokio socket adapter.
Documentation
//! Read an `rtmp://` or `rtmps://` publish URL into a typed [`RtmpTarget`]:
//! host, port (1935 or 443 when absent), TLS, application and stream key.
//!
//! ```text
//! cargo run -p rtmp-runtime --features target --example parse_target
//! ```

use rtmp_runtime::target::RtmpTarget;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    for url in [
        "rtmp://ingest.example/live/camera-1",
        "rtmps://ingest.example:8443/app/key%2Fwith%2Fslashes",
    ] {
        let target = RtmpTarget::parse(url).map_err(|e| format!("{url}: {e:?}"))?;
        println!(
            "{url}: host {}, port {}, tls {}, app {:?}, stream key of {} bytes",
            target.host,
            target.port,
            target.tls,
            target.app,
            target.stream_key.len()
        );
    }
    Ok(())
}