actix-ws-proxy

Crates.ioactix-ws-proxy
lib.rsactix-ws-proxy
version0.1.2
sourcesrc
created_at2023-12-30 19:20:26.97382
updated_at2023-12-30 19:24:00.457542
descriptionA websocket proxy for actix_web
homepage
repositoryhttps://git.sr.ht/~liz/actix-ws-proxy
max_upload_size
id1084362
size11,190
Liz (stillinbeta)

documentation

README

builds.sr.ht status crates.io Documentation

actix-ws-proxy

A companion to actix-proxy that handles websockets.

Example

use actix_web::{Error, get, HttpRequest, HttpResponse, web};
#[get("/proxy/{port}")]
async fn proxy(
    req: HttpRequest,
    stream: web::Payload,
    port: web::Path<u16>,
) -> Result<HttpResponse, Error> {
    actix_ws_proxy::start(&req, format!("ws://127.0.0.1:{}", port), stream).await
}

Any errors will result in a disconnect on both sides with the error message as the reason.

Commit count: 0

cargo fmt