Skip to content

Releases: amphp/websocket

2.0.4

28 Oct 21:59
v2.0.4
Compare
Choose a tag to compare

What's Changed

  • Fixed assertion failure when interleaving control frames between continuation frames in Rfc6455FrameCompiler.

Full Changelog: v2.0.3...v2.0.4

2.0.3

28 Dec 23:26
v2.0.3
1dc9d2c
Compare
Choose a tag to compare

What's Changed

  • 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

2.0.2

21 Oct 17:14
v2.0.2
49e6e43
Compare
Choose a tag to compare
  • Fixed #11: Rfc7692Compression::fromClientHeader() now accepts headers including client_max_window_bits without a value.

2.0.1

02 Oct 16:24
v2.0.1
f40de82
Compare
Choose a tag to compare
  • Fixed invoking the onClose handler attached to a client when the client socket is closed abruptly (that is, without sending a close frame).

2.0.0

10 Sep 02:56
v2.0.0
227e285
Compare
Choose a tag to compare

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.

  • Renamed most classes and interfaces to add 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.
  • Added WebsocketException as base class for WebsocketClosedException as well as a new exception, WebsocketParserException.
  • The 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.
  • Move compression related classes into a Compression sub-namespace.
  • Split the parser and frame compiler from the client implementation, now found in the Parser sub-namespace. This change will allow for greater visibility and logging of activity on a websocket connection.
  • Added 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.
  • The callback provided to 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.

2.0.0 Beta 4

26 Apr 04:02
v2.0.0-beta.4
1bdf01a
Compare
Choose a tag to compare
2.0.0 Beta 4 Pre-release
Pre-release
  • Added WebsocketParser, WebsocketParserFactory, Rfc6455Parser, and WebsocketFrameHandler, splitting the frame parser from Rfc6455Client

2.0.0 Beta 3

08 Nov 19:29
v2.0.0-beta.3
abd6781
Compare
Choose a tag to compare
2.0.0 Beta 3 Pre-release
Pre-release
  • Added compatibility with Revolt v1.x

2.0.0 Beta 2

21 Jun 20:03
v2.0.0-beta.2
ab5812a
Compare
Choose a tag to compare
2.0.0 Beta 2 Pre-release
Pre-release
  • Fixed a warning being issued if invalid compressed frame data was received
  • Fixed issue where a slow consuming client would delay closing the connection
  • Moved default value constants from WebsocketClient interface to Rfc5455Client
  • Changed ClientMetadata::$lastHeartbeatAt to be set when the pong frame is received rather than when the ping frame is sent

2.0.0 Beta 1

30 May 19:21
v2.0.0-beta.1
a852cda
Compare
Choose a tag to compare
2.0.0 Beta 1 Pre-release
Pre-release

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.

  • Removed the 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 interfaces
  • Added HeartbeatQueue and RateLimiter interfaces with implementations DefaultHeartbeatQueue and DefaultRateLimiter – these objects replace some of the functionality that was only contained within Rfc6455Client and controlled via Options
  • Opcode is now an enum
  • Added Websocket as a prefix to several classes:
    • Client renamed to WebsocketClient
    • ClientMetadata renamed to WebsocketClientMetadata
    • Message renamed to WebsocketMessage
  • WebsocketClient 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 client
  • Closures provided to WebsocketClient::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.

1.0.3

11 Apr 23:50
v1.0.3
248e9dc
Compare
Choose a tag to compare
  • 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 sends this code when navigating away from a page
  • Fixed undefined array access in rare case where the event loop is exited after receiving a message on the websocket and then re-entered at a later time (amphp/websocket-client#39)