Crate pipebuf_websocket

source ·
Expand description

PipeBuf wrapper for embedded-websocket

This handles websocket protocol only, independent of the transport. So this can be combined with pipebuf_mio or pipebuf_rustls or other crates to meet different needs.

This is efficient because embedded-websocket exposes a slice-based interface and works between buffers provided by the caller. So it is ideal to be wrapped by PipeBuf. Since websocket permits streaming of message data via fragments, a message is here handled as a pipe-buffer allowing the caller to also stream the data if they wish.

On the sending side, a “push” is indicated after each message sent.

TODO: Support client-side with a WebsocketClient wrapper. (Similar to existing code but would need testing.)

TODO: Rewrite this as a native PipeBuf-based websocket implementation that for Ping/Pong/Close consumes only whole frames (with limits), to simplify things. The message content can still be streamed, though. Also see Autobahn testsuite.

Structs§