High-performance C17 web framework with advanced support for modern protocols.
Project details
CWIST is a high-performance C17 web framework designed for modern web applications. It supports HTTP/3, WebTransport, and includes built-in tools like SQLite ORM and robust TLS options. With flexible server modes and efficient networking, CWIST optimizes for both throughput and response time, making it suitable for various workloads.
CWIST is a high-performance web framework and application server crafted in C17, designed to support modern web standards and protocols, including HTTP/1.1, HTTP/2, HTTP/3 (QUIC), WebSocket, and WebTransport. It seamlessly integrates hybrid post-quantum TLS, utilizing efficient encryption algorithms such as X25519MLKEM768, alongside an embedded SQLite ORM for data operations.
To demonstrate the simplicity of creating a web application with CWIST, here’s a basic Hello World example:
#include <cwist/app.h>
static void hello(cwist_http_request *req, cwist_http_response *res) {
(void)req;
cwist_sstring_assign(res->body, "Hello from CWIST!");
}
int main(void) {
cwist_app *app = cwist_app_create();
cwist_app_get(app, "/", hello);
cwist_app_listen(app, 8080);
cwist_app_destroy(app);
return 0;
}
The example above initializes a CWIST application, sets up a route for the root URL, and listens on port 8080 for incoming requests.
CWIST showcases impressive performance metrics. For instance, under high concurrency, CWIST Classic pool achieved 109,648 requests per second with a latency of 2.17ms while the CWIST reactor mode reached 141,933 requests per second, displaying the powerful capabilities of the framework in handling numerous simultaneous connections efficiently.
CWIST is readily available for installation via Homebrew for macOS and Linux users:
brew tap c4punks/cwist
brew install c4punks/cwist/cwist
In summary, CWIST not only provides a robust platform for developing modern web applications but also emphasizes security, performance, and ease of use. It combines state-of-the-art technology and convenience, making it a valuable choice for developers looking to leverage the power of C in web development.
Comments
1Hi, I am a maintainer of CWIST. Please join and see our works. Currently, v4 LTS is shipped for long-term support. Also, we have latest releases to support full-featured experience with CWIST framework.