Registry / networking / ws-stream-tungstenite

ws-stream-tungstenite

JSON →
library0.15.0rscratesunverified

Provide AsyncRead/AsyncWrite over Tungstenite WebSockets.

# Cargo.toml [dependencies] ws_stream_tungstenite = "0.15.0"
INSTALL
IMPORT
SIG · WS-STREAM-TUNGSTEN
W
ws-stream-tungstenite
networkingrustv0.15.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WsStream
use ws_stream_tungstenite::WsStream;

Wrap a TcpStream into a WsStream for async WebSocket communication.

use ws_stream_tungstenite::WsStream; use tokio::net::TcpStream; async fn example() { let tcp = TcpStream::connect("127.0.0.1:8080").await.unwrap(); let ws = WsStream::new(tcp); // use ws as AsyncRead/AsyncWrite }
Debug
Known issues
gotchaRequires an async runtime like tokio or async-std.
fix
Add tokio or async-std as a dependency and use an async main function.
affects: >=0.1.0
Upgrade
Version history
0.15.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
40 hits · last 30 days
node
36
Resources
ws-stream-tungstenite — cargo add ws-stream-tungstenite · libregistry