ahp-ws
WebSocket transport for the Agent Host Protocol (AHP) Rust SDK.
Implements ahp::Transport using tokio-tungstenite, supporting both ws:// and wss://.
Usage
[]
= "0.1"
= "0.1"
= { = "1", = ["full"] }
use ;
use WebSocketTransport;
async
API
WebSocketTransport::connect(url)— open a new connectionWebSocketTransport::from_stream(stream)— wrap an existingtokio-tungstenitestream for custom TLS or connection options
TLS backends
wss:// support is selected by Cargo feature. The default is rustls-tls-native-roots: a pure-Rust TLS stack (no OpenSSL on Linux) with roots loaded from the OS trust store, so dials through a TLS-intercepting egress proxy keep working. Override it with default-features = false and pick one:
| Feature | TLS stack | Trust roots |
|---|---|---|
rustls-tls-native-roots (default) |
rustls (pure Rust) | OS trust store |
rustls-tls-webpki-roots |
rustls (pure Rust) | bundled Mozilla roots |
native-tls |
platform (SChannel / Secure Transport / OpenSSL) | OS trust store |
With no TLS feature enabled, only ws:// works; wss:// fails at connect time. The rustls backends use the ring crypto provider. If more than one backend ends up enabled (e.g. via Cargo feature unification across the dependency graph), native-tls takes precedence, since tokio-tungstenite's automatic connector prefers it.
See also
ahp— the main client crateahp-types— wire types only- Protocol documentation