Skip to main content

Module version

Module version 

Source
Expand description

OCPP version negotiation through the WebSocket subprotocol.

The Sec-WebSocket-Protocol header is the single source of truth for the OCPP version of a connection (OCPP-J 1.6 §3.1.2; 2.0.1/2.1 Part 4 §3.1.2: “If the OCPP version is part of the OCPP-J endpoint URL it SHALL NOT determine the OCPP version to use”). The client lists versions in order of preference; the server answers with exactly one, or with none and then closes the connection.

Enums§

OcppVersion

Functions§

negotiate
Picks the first version offered by the client (in its preference order) that is also acceptable to the server. Returns the version together with the exact token the client sent, which must be echoed back verbatim.