Registry / networking / hyper-tungstenite

hyper-tungstenite

JSON →
library0.19.0rscratesunverified

WebSockets for hyper servers using the tungstenite library.

# Cargo.toml [dependencies] hyper-tungstenite = "0.19.0"
INSTALL
IMPORT
SIG · HYPER-TUNGSTENITE
H
hyper-tungstenite
networkingrustv0.19.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.

HyperWebsocket
use hyper_tungstenite::HyperWebsocket;

Upgrades an HTTP request to a WebSocket connection using hyper and tungstenite.

use hyper_tungstenite::HyperWebsocket; use hyper::{Body, Request, Response}; async fn handle(req: Request<Body>) -> Result<Response<Body>, hyper::Error> { let websocket = HyperWebsocket::from(req); // handle websocket connection Ok(Response::new(Body::empty())) }
Debug
Known issues
gotchaRequires an async runtime like tokio or async-std.
fix
Add tokio as a dependency and use #[tokio::main] or similar.
affects: all
Upgrade
Version history
0.19.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
hyper-tungstenite — cargo add hyper-tungstenite · libregistry