NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #507 most downloaded on Packagist
Shared code for websocket servers and clients.
Latest stable
v2.0.5
Last release 21 days ago
01 Nov 2026
Release timing varies
gaps range from 1 weeks to 2.0 years
Most releases are documented
notes for 11 of 16 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
22 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Security: fix: enforce message size limit on decompressed permessage-deflate data by @webpatser
Full Changelog: v2.0.4...v2.0.5
Full Changelog: https://github.com/amphp/websocket/compare/v2.0.4...v2.0.5
Fixed assertion failure when interleaving control frames between continuation frames in Rfc6455FrameCompiler .
Rfc6455FrameCompiler.Full Changelog: v2.0.3...v2.0.4
Your coding agent can read these notes before it upgrades. Set up the MCP server →
WebsocketException now extends Amp\ByteStream\StreamException to avoid violating the ReadableStream interface by throwing a non- StreamException from
WebsocketException now extends Amp\ByteStream\StreamException to avoid violating the ReadableStream interface by throwing a non-StreamException from a stream method.Full Changelog: v2.0.2...v2.0.3
Fixed #11 : Rfc7692Compression::fromClientHeader() now accepts headers including client_max_window_bits without a value.
Rfc7692Compression::fromClientHeader() now accepts headers including client_max_window_bits without a value.Fixed invoking the onClose handler attached to a client when the client socket is closed abruptly (that is, without sending a close frame).
Stable release compatible with AMPHP v3 and fibers! 🎉
Stable release compatible with AMPHP v3 and fibers! 🎉
As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.
Websocket as a prefix to avoid name collisions with similarly named classes in other packages which are frequently used together. For example, Client is now WebsocketClient, Message is now WebsocketMessage.WebsocketMessage (formerly Message) now implements Stringable, allowing the object to be simply cast to a string to buffer the contents of a message. Max message limits set on the client will apply.WebsocketException as base class for WebsocketClosedException as well as a new exception, WebsocketParserException.Options object has been removed. Various configurations options previously available in this class can now be specified by constructor arguments to various factories, such as Rfc6455ParserFactory in this library or the client factories found in amphp/websocket-server and amphp/websocket-client.Compression sub-namespace.Parser sub-namespace. This change will allow for greater visibility and logging of activity on a websocket connection.WebsocketHeartbeatQueue and WebsocketRateLimit interfaces with implementations PeriodicHeartbeatQueue and ConstantRateLimit. These interfaces and implementations offer greater extensibility and fine-tuning of connection behavior, while maintaining easy setup for most applications.ClientMetadata has been removed in favor of WebsocketCount and WebsocketTimestamp enums coupled with methods on a WebsocketClient, getCount() and getTimestamp(), to query for connection info.WebsocketClient::onClose() is now invoked with two arguments – the Websocket client ID and an instance of WebsocketCloseInfo providing the close code, reason, time, and whom initiated the close.WebsocketParser, WebsocketParserFactory, Rfc6455Parser, and WebsocketFrameHandler, splitting the frame parser from Rfc6455ClientWebsocketClient interface to Rfc5455ClientClientMetadata::$lastHeartbeatAt to be set when the pong frame is received rather than when the ping frame is sentInitial release compatible with AMPHP v3.
As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.
Options object. Settings that were set using properties on the Options object are now parameters to client factories in the websocket-client and websocket-server libraries or the HeartbeatQueue and RateLimiter interfacesHeartbeatQueue and RateLimiter interfaces with implementations DefaultHeartbeatQueue and DefaultRateLimiter – these objects replace some of the functionality that was only contained within Rfc6455Client and controlled via OptionsOpcode is now an enumWebsocket as a prefix to several classes:
Client renamed to WebsocketClientClientMetadata renamed to WebsocketClientMetadataMessage renamed to WebsocketMessageWebsocketClient now extends Amp\Closable
isConnected() method replaced with isClosed()WebsocketClient::receive() now supports cancellation. Cancelled receives do not discard a message, a subsequent call to receive() will still return the next message received from the clientWebsocketClient::onClose() are provided an instance of WebsocketClientMetadata instead of the client object, close code, and reason. The code and reason are available on the metadata object.Added WebsocketParser, WebsocketParserFactory, Rfc6455Parser, and WebsocketFrameHandler, splitting the frame parser from Rfc6455Client
WebsocketParser, WebsocketParserFactory, Rfc6455Parser, and WebsocketFrameHandler, splitting the frame parser from Rfc6455ClientAdded compatibility with Revolt v1.x
Fixed a warning being issued if invalid compressed frame data was received
WebsocketClient interface to Rfc5455ClientClientMetadata::$lastHeartbeatAt to be set when the pong frame is received rather than when the ping frame is sentInitial release compatible with AMPHP v3.
Initial release compatible with AMPHP v3.
As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.
Options object. Settings that were set using properties on the Options object are now parameters to client factories in the websocket-client and websocket-server libraries or the HeartbeatQueue and RateLimiter interfacesHeartbeatQueue and RateLimiter interfaces with implementations DefaultHeartbeatQueue and DefaultRateLimiter – these objects replace some of the functionality that was only contained within Rfc6455Client and controlled via OptionsOpcode is now an enumWebsocket as a prefix to several classes:
Client renamed to WebsocketClientClientMetadata renamed to WebsocketClientMetadataMessage renamed to WebsocketMessageWebsocketClient now extends Amp\Closable
isConnected() method replaced with isClosed()WebsocketClient::receive() now supports cancellation. Cancelled receives do not discard a message, a subsequent call to receive() will still return the next message received from the clientWebsocketClient::onClose() are provided an instance of WebsocketClientMetadata instead of the client object, close code, and reason. The code and reason are available on the metadata object.Security: fix: enforce message size limit on decompressed permessage-deflate data by @webpatser
Full Changelog: v1.0.3...v1.0.4
Full Changelog: https://github.com/amphp/websocket/compare/v1.0.3...v1.0.4
Added GOING_AWAY to the list of normal close codes, which will cause Client::receive() to return null instead of throwing an exception if a browser se
GOING_AWAY to the list of normal close codes, which will cause Client::receive() to return null instead of throwing an exception if a browser sends this code when navigating away from a pageFixed frames per second option (was setting wrong value prior)
Fixed calculation of ping interval
Message constructor is now private, replaced with static constructors fromText() and fromBinary().
Initial release. 🎉
Message constructor is now private, replaced with static constructors fromText() and fromBinary().Client::send() and Client::stream() promises now resolve with void instead of an int (the integer returned was sometimes 0, so it wasn't particularly useful).Client::didPeerInitiateClose() to Client::isClosedByPeer().Fixed marking that peer initiated close when remote socket closes.
Rfc6455Client::receive() is now failed if the connection closes with a non-normal close code instead of resolving with null (which remains the case on normal closure). (#5)Code::getName(int $code) that returns the constant name for the given code or null if it is not defined.ClientMetadata are now set using Amp\getCurrentTime() instead of time().*Note: v0.1.x and v0.2.x tags in this repository are for our WebSocket client, which has been moved to `amphp/websocket-client`. v1.0 will be the init
First release candidate.
Note: v0.1.x and v0.2.x tags in this repository are for our WebSocket client, which has been moved to amphp/websocket-client. v1.0 will be the initial release of this library.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.