Repository navigation
Installation
CWIST builds from source on Linux, macOS and FreeBSD. It vendors its heavy dependencies (BoringSSL, lsquic, libttak, cJSON, uriparser, cnats, multipart-parser-c, usrsctp) as git submodules and downloads the SQLite amalgamation during the first build, so a build needs only a C/C++ toolchain and a few system libraries.
The tap installs the latest release from its source tarball:
brew tap c4punks/cwist
brew install cwist
# or, without tapping first:
brew install c4punks/cwist/cwistThe formula installs libcwist.a, the public headers, the cwist CLI and the
cwist.pc pkg-config file under the Homebrew prefix.
| Platform | Packages |
|---|---|
| Debian / Ubuntu | build-essential cmake pkg-config libcurl4-openssl-dev libnghttp2-dev libbrotli-dev libzstd-dev zlib1g-dev |
| Fedora / RHEL | gcc gcc-c++ make cmake pkgconf libcurl-devel libnghttp2-devel brotli-devel libzstd-devel zlib-devel |
| macOS (Homebrew) | cmake pkg-config curl nghttp2 brotli zstd |
cmake builds the vendored BoringSSL, lsquic, uriparser, cnats and usrsctp.
A C++ compiler is required because BoringSSL contains C++ sources.
git clone --recursive https://github.com/c4punks/CWIST.git
cd CWIST
make -j"$(nproc)"If the repository was cloned without --recursive, run
git submodule update --init --recursive first. The Makefile initializes the
lsquic and usrsctp submodules on its own, but not the others.
The first build downloads sqlite-amalgamation from sqlite.org into
lib/sqlite3/. On a machine without network access, build from a release
tarball instead (see below), which already contains it.
sudo make install # PREFIX defaults to /usr/local
make install PREFIX=/opt/cwist # custom prefix
make install PREFIX=/usr DESTDIR=/tmp/pkgroot # staged install for packagingmake install writes:
| Path | Contents |
|---|---|
$PREFIX/lib/libcwist.a |
the CWIST objects only (a "thin" archive, see Linking) |
$PREFIX/lib/cwist/ |
the bundled dependency archives (BoringSSL, lsquic, libttak, cJSON, uriparser, cnats, usrsctp) |
$PREFIX/include/cwist/ |
public CWIST headers |
$PREFIX/include/cwist/vendor/ |
headers of the bundled dependencies |
$PREFIX/lib/pkgconfig/cwist.pc |
pkg-config metadata |
$PREFIX/bin/cwist |
the project CLI |
$PREFIX/share/doc/cwist/ |
LICENSE, NOTICE.md and every vendored license |
| Variable | Default | Effect |
|---|---|---|
WERROR=1 |
unset | Treat warnings as errors (CI uses this). Vendored sources are exempt. |
SANITIZE=address,undefined |
unset | Build the library and tests with the given sanitizers (disables LTO). |
CWIST_WEBRTC=0 |
1 |
Leave out the WebRTC DataChannel module (src/net/webrtc/) and usrsctp. |
CWIST_WEBTRANSPORT=0 |
1 |
Leave out the WebTransport client. Only dev pins an lsquic that has the required API; see WebTransport. |
PREFIX, DESTDIR
|
/usr/local, empty |
Install location and staging root. |
make test # full suite
make SANITIZE=address,undefined test # what the ASan/UBSan CI job runs
make tutorials-check # compile every tutorial against the libraryEvery release publishes cwist-<version>.tar.gz with all submodule sources and
the SQLite amalgamation included, so it builds without git or network access:
curl -LO https://github.com/c4punks/CWIST/releases/download/v3.9/cwist-3.9.tar.gz
tar xf cwist-3.9.tar.gz && cd cwist-3.9
make -j"$(nproc)" && make testMaintainers create the archive with make dist VERSION=X.Y.Z.
An in-tree vcpkg port draft lives under
packaging/vcpkg/.
It has not been submitted upstream.
Browser (Emscripten) and WASI builds use separate make targets; see WASM Browser Builds and WASI.
Quick Start builds and runs a first server; Linking explains the flags an application needs.
CWIST wiki, written against the dev branch of c4punks/CWIST. Pages marked "Source:" are generated from files under docs/; fix those in the repository. Questions: Discord.
Getting started
- Installation
- Quick Start
- Linking
- Server Modes
- Configuration and Environment
- Project CLI
- Tutorial / Korean
- Examples and Tutorials
Guides
Core
- API Reference
- Application
- Routing
- Middleware
- Requests and Responses
- Async Handlers
- Streaming Responses
- Error Handling
- Graceful Shutdown
- Multiport
Protocols
- HTTPS and TLS
- HTTP/2
- HTTP/3 and QUIC
- WebTransport
- WebSocket
- Server-Sent Events
- gRPC Server
- gRPC Client
- Protobuf and Codegen
- GraphQL
- WebRTC DataChannels
- HTTP Clients
Web features
- Static Files and Assets
- Big Dumb Reply Cache
- Compression
- Cookies
- Sessions and Flash
- Query Maps
- Multipart Uploads
- HTML Components
- Templates
- JSON
- Validation
- OpenAPI
Security
Data
Runtime
- Memory Management
- Full GC
- Async GC Ownership
- SString
- Reactor and I/O
- Metrics and Health
- Logging
- Testing
Platforms
Performance notes
- Benchmark Methodology
- C1M File Limits
- Reactor Fairness
- Cooperative Queuing
- Classic Pool Starvation
- Reactor Wakeup
- wrk Dual Histogram
- FIXED Endpoint Cache
- ADR-0001
- Durable Queue Gate
- Mux References
Project