hpx-fastwebsockets
A fast, minimal RFC 6455 WebSocket implementation.
This crate is part of the hpx project. It is a fork of fastwebsockets by Divy Srivastava.
Passes the Autobahn test suite and fuzzed with LLVM's libfuzzer. Can be used as a raw WebSocket frame parser or as a full-fledged WebSocket server/client.
Quick Start
use TcpStream;
use ;
use Result;
async
HTTP Upgrade (with hyper)
use upgrade;
use ;
use Empty;
use Bytes;
async
Feature Flags
| Feature | Default | Description |
|---|---|---|
simd |
Yes | SIMD-accelerated UTF-8 validation |
upgrade |
Yes | HTTP upgrade support (requires hyper) |
unstable-split |
No | Split WebSocket into read/write halves |
with_axum |
No | Axum WebSocket extractor integration |
Key Types
WebSocket<S>— Main WebSocket struct for reading/writing framesFrame— A WebSocket frame with opcode and payloadOpCode— Frame opcodes (Text, Binary, Close, Ping, Pong, Continuation)FragmentCollector<S>— Aggregates fragmented messages into complete framesRole— Server or Client role (controls masking behavior)
License
Apache-2.0