property WebSocket.extensions
Returns the extensions selected by the server, if any.
WebSocket extensions add optional features negotiated during the handshake via
the Sec-WebSocket-Extensions
header.
At the time of writing, there are two registered extensions:
permessage-deflate
: Enables per-message compression using DEFLATE.bbf-usp-protocol
: Used by the Broadband Forum's User Services Platform (USP).
See the full list at IANA WebSocket Extensions.
Example:
const ws = new WebSocket("ws://localhost:8080");
console.log(ws.extensions); // e.g., "permessage-deflate"
Type #
string