Skip to content

Releases: uNetworking/uWebSockets

v20.36.0

08 Jan 22:52
Compare
Choose a tag to compare
  • Yet more fixes to subscription events

v20.35.0

03 Jan 20:52
8cf7e73
Compare
Choose a tag to compare
WebSocket subscription handler broken

v20.34.0

28 Dec 06:31
Compare
Choose a tag to compare

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

27 Dec 18:41
1612690
Compare
Choose a tag to compare

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

24 Dec 11:35
Compare
Choose a tag to compare

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.

v20.31.0

26 Nov 05:00
Compare
Choose a tag to compare
  • Don't use strftime for Date header (it depends on locale)

v20.30.0

04 Nov 17:51
Compare
Choose a tag to compare
  • Fixes undefined behavior introduced in v20.28.0

v20.29.0

02 Nov 11:45
7d74e50
Compare
Choose a tag to compare

Hooking up Windows testing

  • GitHub Actions now builds and runs the unit tests and smoke test on Windows on every push.
  • The server was entirely broken on Windows, since the changes in v20.28.0 which is now fixed thanks to @rehans

v20.28.0

01 Nov 05:20
Compare
Choose a tag to compare

More RFC 9112 (HTTP/1.1) compliance fixups

  • Field names are now restricted to alphanumeric + hyphen
  • Chunked encoding parsing now properly rejects too large chunks
  • Chunked encoding now rejects non-hex chunk size and handles A-F, a-f, 0-9 properly
  • The Host field has to be present, but is allowed to have empty value
  • Field values are trimmed both front and back, by SP and HTAB only
  • Request method is now case sensitive and getCaseSensitiveMethod() has been added
  • getMethod() will continue to return lower cased for backwards compatibility until v21.

Performance regression testing

  • Performance comparison against the v20.0.0 release shows there is no performance drift. We haven't lost any measurable performance by improving spec. compliance.

Smoke testing on CI

  • There is a new smoke test that makes a bunch of different fetch() requests in keep-alive using Deno, checking CRC32 hashes for correctness both for chunked encoding and for fixed length bodies. This test runs on CI automatically on every push along the unit tests. It will be extended with more request types in the near future.

v20.27.0

29 Oct 02:58
3f72aea
Compare
Choose a tag to compare

Initial C-API

Contributed by Ciro Spaciari (@cirospaciari) - there is now a quite complete C API that can be used from Zig, Rust and the like. Some form of this C API is already in use by Bun.