Skip to content

Releases: uNetworking/uWebSockets

v20.41.0

Choose a tag to compare

@uNetworkingAB uNetworkingAB released this 07 May 04:14
464e7d6
  • Adds the Autobahn|Testsuite as an automatic test run by GitHub Actions, rather than manually.
  • A WebSocket parser benchmark has been added.
  • A few optimizations to the WebSocketProtocol.h.

v20.40.0

Choose a tag to compare

@uNetworkingAB uNetworkingAB released this 30 Apr 21:54

Fixes an edge case where URI querystrings with keys with no value gets interpreted as invalid querystring.

Now the querystring "?one=&two=hello%20world" is considered valid, and HttpRequest.getQuery("two") will return "hello world" like it should.

This release also adds testing for the above case.

v20.39.0

Choose a tag to compare

@uNetworkingAB uNetworkingAB released this 21 Apr 17:37
  • Fixes a bug introduced in the bug fix of v20.38.0 🥇
  • Adds new fuzz target for involved functionality

v20.38.0

Choose a tag to compare

@uNetworkingAB uNetworkingAB released this 15 Apr 20:34

Fixes an edge case where calling HttpResponse::upgrade inside HttpResponse::cork from inside a third-party callback would crash.

Full Changelog: v20.37.0...v20.38.0

v20.37.0

Choose a tag to compare

@uNetworkingAB uNetworkingAB released this 07 Mar 08:35
8410f7e

What's Changed

New Contributors

Full Changelog: v20.36.0...v20.37.0

v20.36.0

Choose a tag to compare

@uNetworkingAB uNetworkingAB released this 08 Jan 22:52
  • Yet more fixes to subscription events

v20.35.0

Choose a tag to compare

@uNetworkingAB uNetworkingAB released this 03 Jan 20:52
8cf7e73
WebSocket subscription handler broken

v20.34.0

Choose a tag to compare

@uNetworkingAB uNetworkingAB released this 28 Dec 06:31

Easy shutdown with App.close()

Calling this new function will:

  • Close and invalidate all open listen sockets.
  • Force close all open connections (both HTTP and WebSockets), calling their respective callbacks as needed (.onAborted, .close, .subscription).

This call can be used to gracefully close and release an App that needs maintenance.

v20.33.0

Choose a tag to compare

@uNetworkingAB uNetworkingAB released this 27 Dec 18:41
1612690

Rebalancing with maxLifetime

A reworked timeout system now allows two lightweight timeout settings for WebSockets; idleTimeout (up to 16 minutes) and maxLifetime (up to 4 hours):

  • idleTimeout is how long (in seconds) a WebSocket may be idle (have no traffic) before it is considered closed.
  • maxLifetime is how long (in minutes) a WebSocket may be connected, before being gracefully closed by the server.

Specifying a value of 0 disables respective feature (the default for maxLifetime).

Why use maxLifetime?

The idea here is to enforce a partial rebalancing, constantly forcing a few connections to reconnect via whatever load balancer in use. This is a strategy used by Netflix where they found success in having maxLifetime = 30 minutes.

Good values for the settings should be somewhere around 30-120 seconds idleTimeout and 30-120 minutes maxLifetime.

v20.32.0

Choose a tag to compare

@uNetworkingAB uNetworkingAB released this 24 Dec 11:35

Subscription events

A new kind of event has been added. Whenever a WebSocket::subscribe or WebSocket::unsubscribe call is made, or when implicit unsubscription happens (such as when a WebSocket has subscriptions and gets closed in any way), a subscription event will fire with:

  • the WebSocket involved
  • the topic name
  • the new number of subscribers to this topic
  • the former number of subscribers to this topic

These events can be used to easily manage external subscriptions such as when using Redis to orchestrate multiple instances of uWS. Whenever a subscription event with new subscription count == 1; you can create the corresponding Redis subscription. Whenever a subscription event with new subscription count == 0; you can free the corresponding Redis subscription.