uWebSockets

Simple, secure & standards compliant web server for the most demanding of applications

APACHE-2.0 License

Downloads
13
Stars
16.9K
Committers
45

Bot releases are visible (Hide)

uWebSockets - v20.62.0 Latest Release

Published by uNetworkingAB 7 months ago

RFC 9110 fix part trois

  • DQUOTE is not a valid field name char
  • "431 Request Header Fields Too Large" will be emitted more strictly
    • Reminder: you can set the environment variable UWS_HTTP_MAX_HEADERS_SIZE higher if you need to
uWebSockets - v20.61.0

Published by uNetworkingAB 7 months ago

RFC 9110 fix part deux

Previous release did not fix all problems with, for instance, underscores in HTTP field names. This release properly fixes such cases and also makes the HTTP server 14% faster in user space.

A new benchmarking project has been added for reliably benchmarking the entire user space portion of the server by overriding epoll syscalls with traffic producing alternatives. This is a similar approach to how we currently fuzz the user space.

uWebSockets - v20.60.0

Published by uNetworkingAB 8 months ago

RFC 9110 fix

A misinterpretation of the spec. has been fixed re. HTTP field names. If you rely on field names that aren't just alphanum + hyphen, this release should fix your use.

uWebSockets - v20.59.0

Published by uNetworkingAB 8 months ago

  • Bumps uSockets to v0.8.8
  • Minor fixes
uWebSockets - v20.58.0

Published by uNetworkingAB 9 months ago

Parameter routing fixes

Having multiple URL routes with differently named parameter segments at the same depth in the routing tree would cause the order of matching to be potentially different from what the documentation stated.

This release fixes that, and adds more testing for this scenario.

uWebSockets - v20.57.0

Published by uNetworkingAB 9 months ago

Experimental cross-platform uWS::LocalCluster

We've always supported multi-CPU scaling as detailed in the HelloWorldThreaded.cpp example and benchmarking blog posts. However, this example has only been properly supported on Linux systems and contained some really ugly boiler plate code.

This release adds the uWS::LocalCluster helper that works properly on Windows, macOS, Linux and makes it easy to take any single-CPU app and make it scale over all available CPU-cores by default:

uWS::App(options).get(pattern, handler).listen(port, handler).run();

simply becomes

uWS::LocalCluster(options, [](uWS::App &app) {
  app.get(pattern, handler).listen(port, handler);
});

This is reflected in the updated HelloWorldThreaded.cpp example and works for both SSL and non-SSL clusters.

v20.56.0 on macOS (capped at 99% CPU-time)

v20.57.0 on macOS (approaches 800% CPU-time)

uWebSockets - v20.56.0

Published by uNetworkingAB 9 months ago

SSL fixes

  • Don't crash on addServerName when provided files are missing
  • Disable a (broken) per-SSL optimization that caused issues with backpressure in certain cases
uWebSockets - v20.55.0

Published by uNetworkingAB 10 months ago

  • Adds named parameter getters (as complement to integral offset getters) like so:
	/* Define a parameter route */
	.get("/:first/static/:second", [](auto *res, auto *req) {

		/* Use the value of a parameter as response */
		res->write("<h1>first is: ");
		res->write(req->getParameter("first"));
		res->write("</h1>");

		res->write("<h1>second is: ");
		res->write(req->getParameter("second"));
		res->end("</h1>");

	})
  • Adds new example showing the above in use.
uWebSockets - v20.54.0

Published by uNetworkingAB 10 months ago

  • Bumps the maximum HTTP receive body size from 30 bits to 62 bits (1 GB -> 4294967296 GB)
uWebSockets - v20.53.0

Published by uNetworkingAB 10 months ago

  • Fixes the bug of upgrading to websocket within HttpResponse::cork callback.
uWebSockets - v20.52.0

Published by uNetworkingAB 10 months ago

  • Routes are overwritten by default (no need to first remove it manually).
uWebSockets - v20.51.0

Published by uNetworkingAB 10 months ago

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.
uWebSockets - v20.50.0

Published by uNetworkingAB 10 months ago

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.
uWebSockets - v20.49.0

Published by uNetworkingAB 10 months ago

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.

uWebSockets - v20.48.0

Published by uNetworkingAB 11 months ago

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: https://github.com/uNetworking/uWebSockets/compare/v20.47.0...v20.48.0

uWebSockets - v20.47.0

Published by uNetworkingAB about 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/uNetworking/uWebSockets/compare/v20.46.0...v20.47.0

uWebSockets - v20.46.0

Published by uNetworkingAB about 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/uNetworking/uWebSockets/compare/v20.45.0...v20.46.0

uWebSockets - v20.45.0

Published by uNetworkingAB over 1 year ago

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.

uWebSockets - v20.44.0

Published by uNetworkingAB over 1 year ago

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:

screencapture-localhost-9002-some-path-2023-05-28-11_37_12

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:

screencapture-localhost-3000-2023-05-28-11_41_15

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.

uWebSockets - v20.43.0

Published by uNetworkingAB over 1 year ago

PROXY v2 support

  • Restores function to this haproxy protocol, as broken by some refactor way back.