Releases: uNetworking/uWebSockets
v20.51.0
Dynamic 404 page
The 404 page is no longer a static error page that severs the connection, but now lives as a default route for App.any("/*")
. This means two things:
- You can remove it by calling
App.any("/*", nullptr)
or attach your own page to that route. - It won't kill the connection as if a true protocol error, but will use proper keep alive instead.
v20.50.0
Some much needed HTTP adjustments
The ANY method (App::any) will now properly match with all possible HTTP methods, not just all of the standard ones. This is needed to properly implement your own (reliable) 404 page, or to reliably route all traffic to some common handler (what Bun does).
A slight behavioral change was needed:
- Matching is now ordered by method first, URL second. This means that, for instance, a match with static method and parameter URL will match before an ANY method with static URL. This is very similar to previous behavior, but more easy to understand and simpler to implement.
This behavioral change should be practically unnoticeable.
More:
- Adds the environment variable UWS_HTTP_MAX_HEADERS_SIZE for controlling maximum (total) HTTP header size allowed. Default is 4kb.
- Adjusts the default maximum header count allowed, raised from 50 to 100 and controlled explicitly via added compiler define UWS_HTTP_MAX_HEADERS_COUNT.
v20.49.0
Dropped events, anonymous error pages
A new kind of event, "dropped" can be used to track when an outgoing message has been dropped due to current backpressure settings. This is useful in cases where tracking the status is otherwise impossible, such as when using pub/sub. See example "EchoServer.cpp" for usage.
Another change is the removal of graphical error pages (the HTML body is gone) when compiling with UWS_HTTPRESPONSE_NO_WRITEMARK.
v20.48.0
Pub/sub fix
Being subscribed to only one topic, followed by a publish to said topic immediately followed by unsubscription from this, single one, topic would drop the published message before it was sent. This is now fixed and no message will be dropped in this edge case.
This bug did not trigger in cases where a WebSocket was subscribed to at least one more topic, making most real-world use cases unaffected.
Full Changelog: v20.47.0...v20.48.0
v20.47.0
What's Changed
- Don't lose ws frame payload when its header went to backpressure by @ypogribnyi in #1662
New Contributors
- @ypogribnyi made their first contribution in #1662
Full Changelog: v20.46.0...v20.47.0
v20.46.0
What's Changed
- Prevent reading beyond end of file by @janssen70 in #1626
- Silence unused variable warning by @glingy in #1613
- use SocketContextOptions type so HttpServer example will build again by @mumbleskates in #1397
- #1617 fix warning: 'sprintf' is deprecated from macOS by @calvin2021y in #1630
- Restore the bytes overwritten by the tail after inflation by @OxleyS in #1653
New Contributors
- @janssen70 made their first contribution in #1626
- @glingy made their first contribution in #1613
- @mumbleskates made their first contribution in #1397
- @calvin2021y made their first contribution in #1630
- @OxleyS made their first contribution in #1653
Full Changelog: v20.45.0...v20.46.0
v20.45.0
Default 404 page
This release adds another error page; the 404 File Not Found. Along with the recently added error codes, this should make it a lot easier to debug proxy issues / log misbehaving clients or the like.
Instead of simply getting a RST (which often times results in 502), proxies and end clients now get the proper 404 error code for any unhandled URL / method.
This new behavior can be tested by running the EchoServer example and requesting any HTTP page.
v20.44.0
HTTP error pages
NGINX is a silly proxy. It's very common for users to report issues with NGINX, and it's easy to understand. If you set up NGINX as proxy for uWS, you will most likely get a spinning wheel followed by 502 Bad Gateway as if the uWS server is unreachable.
This is because NGINX defaults to the 27 year old, ancient, HTTP/1.0 when talking to backend servers. uWS naturally does not support this protocol, and is only fully standards compliant with the 26 years younger HTTP/1.1 RFC9112.
However, ideology aside, it would be nice if uWS played along with existing ecosystems. Now it does:
This page is what you will see after setting up NGINX to proxy uWS. From this error it should hint of the proxy_http_version 1.1 config in NGINX. Once applied, the NGINX -> uWS combo will give you this:
You can see and configure the error pages in src/HttpErrors.h. More errors will be added as they are needed. The default style is a minimal Apache-like page.
v20.43.0
PROXY v2 support
- Restores function to this haproxy protocol, as broken by some refactor way back.
v21.0.0-alpha2
v21 and io_uring
With more features added, more optimizations and more examples working properly, here's the current performance metrics comparing uWS v21 against latest denoland/fastwebsockets v0.4.2. As an aside, uWS can now do URL routed HTTP requests at 350k req/sec, which is even faster than what an optimized epoll server can do raw TCP echoing (325k msg/sec) on this machine. Just think about that for a moment - uWS is serving standards compliant HTTP faster than you could do even raw TCP a few years ago. Mind blown.