A client & server implementation of the WAMP-like RPC-over-websocket system defined in the OCPP-J protocols (e.g. OCPP1.6J, OCPP2.0.1J and OCPP2.1).
Requires Node.js >= 20
This module is built for Node.js and does not currently work in browsers.
- Anyone building an OCPP-based Charging Station or Charging Station Management System (CSMS) using Node.js.
- Anyone looking for a simple yet robust symmetrical RPC framework that runs over WebSockets.
- 🛂 Authentication - Optional authentication step for initiating session data and filtering incoming clients.
- 🔒 OCPP Security - Compatible with OCPP security profiles 1, 2 & 3.
- 💬 Serve multiple subprotocols - Simultaneously serve multiple different subprotocols from the same service endpoint.
- ✅ Strict Validation - Optionally enforce subprotocol schemas to prevent invalid calls & responses.
- Automatic reconnects - Client supports automatic exponential-backoff reconnects.
- Automatic keep-alive - Regularly performs pings, and drops dangling TCP connections.
- Graceful shutdowns - Supports waiting for all in-flight messages to be responded to before closing sockets.
- Clean closing of websockets - Supports sending & receiving WebSocket close codes & reasons.
- Embraces abort signals -
AbortSignals can be passed to most async methods. - Optional HTTP server - Bring your own HTTP server if you want to, or let
RPCServercreate one for you.
npm install ocpp-rpcSee the Getting Started guide in the API docs.
Full API documentation and guides are available.
See the Upgrade guide.
- ocpp-rpc: Licensed under the MIT License
- OCPP 1.6, OCPP 2.0.1 & OCPP 2.1 JSON schemas: Licensed from the Open Charge Alliance under Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0).
