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-LengthandTransfer-Encoding: chunked -
buffered and streaming body APIs
-
basic TCP client and server helpers
-
keep-alive support for HTTP/1.1
-
Linux
epollevent loop for server workloads -
Linux prefork serving with
SO_REUSEPORT -
TCP_NODELAYenabled for client connections and accepted server sockets
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 for the supported public surface.
Request/ResponseClient.send/Client.send_urlServer.listen/Server.serve_once/Server.serveServer.serve_evented/Server.serve_preforkread_request/read_responsewrite_request/write_response