https://github.com/jotrorox/c3ttp.c3l
Small HTTP/1.1 client and server library for C3, built on std::net::tcp.
https://github.com/jotrorox/c3ttp.c3l
c3 c3-lib c3lang http http-client http-framework http-server library
Last synced: 2 days ago
JSON representation
Small HTTP/1.1 client and server library for C3, built on std::net::tcp.
- Host: GitHub
- URL: https://github.com/jotrorox/c3ttp.c3l
- Owner: Jotrorox
- License: mit
- Created: 2026-03-31T11:16:06.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-05-23T03:08:50.000Z (27 days ago)
- Last Synced: 2026-05-23T05:25:06.195Z (27 days ago)
- Topics: c3, c3-lib, c3lang, http, http-client, http-framework, http-server, library
- Language: C3
- Homepage:
- Size: 765 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# c3ttp
Small HTTP/1.1 client and server library for C3, built on `std::net::tcp`.
- `c3ttp.c3i`: public API
- `src/`: implementation
- `test/`: package tests
- `examples/`: usage examples
- HTTP/1.1 request and response parsing
- `Content-Length` and `Transfer-Encoding: chunked`
- buffered and streaming body APIs
- basic TCP client and server helpers
- keep-alive support for HTTP/1.1
- Linux `epoll` event loop for server workloads
- Linux prefork serving with `SO_REUSEPORT`
- `TCP_NODELAY` enabled for client connections and accepted server sockets
```bash
c3c compile-test .
(cd examples/hello_server && c3c build)
(cd examples/client_get && c3c build)
(cd examples/router_simple && c3c build)
```
For long-lived servers, do not initialize `Server` with `tmem`. Use `mem` or another non-temp allocator so per-request allocations can be reclaimed normally across many requests.
See [`c3ttp.c3i`](https://github.com/Jotrorox/c3ttp.c3l/blob/main/c3ttp.c3i) for the supported public surface.
- `Request` / `Response`
- `Client.send` / `Client.send_url`
- `Server.listen` / `Server.serve_once` / `Server.serve`
- `Server.serve_evented` / `Server.serve_prefork`
- `read_request` / `read_response`
- `write_request` / `write_response`