codetics-ocpp-ws
A small WebSocket implementation for OCPP-J, written for servers holding tens of thousands of long-lived connections:
- RFC 6455 framing, fragmentation, control frames and close handshake;
- RFC 7692 permessage-deflate, which OCPP 2.0.1 and 2.1 require from a CSMS, with a memory profile suited to idle connections (pooled compressors, lazily allocated decompressors);
- a cancel-safe reader (
WsReader::recv) and a separate writer, so one task can multiplex reads, timers and commands; - a minimal client (
client::connect/client::handshake) for simulators and tests.
The HTTP upgrade is left to your HTTP server (hyper, axum, …): wrap the upgraded stream with server().
use ;
async
Part of Codetics OCPP
This crate belongs to Codetics OCPP, a complete OCPP 1.6J / 2.0.1 / 2.1 implementation in Rust written by Kevin Vavelin (Codetics). It can be used as is; contributions are welcome.
License and credit
Licensed under the Apache License, Version 2.0.
Copyright 2026 Kevin Vavelin, Codetics. Any redistribution of this crate or of a work derived from it (including forks and products embedding it) must keep the copyright notice and include the NOTICE file crediting Kevin Vavelin / Codetics as the origin of the work.