C++17 · HTTP/1.1 · MIT

A small
HTTP server.

Define response fixtures in JSON and serve static files from the same process. Built with C++17, Boost.Asio, and Boost.Beast.

By R. Amogh.

EXAMPLE / GET RESPONSE
GET/helloHTTP/1.1
01Accept & parseBoost.Beast
02Match the routeroutes.json
03Write the responseBoost.Asio
200 OKtext/plain
hello, Tez
Linux & macOSNative amd64 + arm64 imagesJSON routes + static filesGET + HEAD fixtures

01 / GET STARTED

Run with Docker

Start the development image and check the health endpoint.

Installation guide
Docker · development build
# Start Tez
docker run --rm --pull=always --name tez \
  --read-only --cap-drop=ALL \
  --security-opt=no-new-privileges \
  -p 127.0.0.1:8080:8080 ramogh2404/tez:main

# In another terminal
curl --fail http://127.0.0.1:8080/health
{"status":"ok"}

Stop with Ctrl-C or docker stop tez. main is a mutable development tag. Pin a verified digest for deployments.

02 / USE CASES

Local development
and HTTP internals

Use fixed responses to test a client, serve a frontend locally, or study how a C++ server handles requests.

01

Test against fixed responses

Keep success and error responses in Git. Make your client handle both before the backend is ready.

GET /fixtures/profile → 200
GET /fixtures/unavailable → 503
Build a response
02

Serve static files

Serve a small frontend and its response fixtures from the same origin. Point Tez at an explicit static root.

--static-dir examples/fixtures/staticTry the working example
03

Read the implementation

The architecture guide covers parsing, connection lifetime, routing, and response writes, with links to the source.

accept → parse → dispatch → writeWalk through the internals

03 / IMPLEMENTATION

How requests
are handled

Read the design decisions
01 / ACCEPT

Connection limits

Connection admission has an explicit limit. Each admitted connection gets a session.

02 / PARSE

HTTP parsing

Beast parses HTTP. Tez validates the target, framing, and request limits.

03 / DISPATCH

Route selection

Immutable JSON routes, built-in handlers, or a confined static file reader.

04 / WRITE

Response writes

The response stays alive until the asynchronous write completes.

Per-session strands keep operations serialized. Persistent connections reuse the session; pipelined responses stay in order.

File reads and logging are synchronous today. The measurement plan records what still needs evidence.

04 / ABOUT

About Tez

Tez is my personal C++ HTTP server project. I use it to work on request parsing, asynchronous I/O, and connection management. The code and engineering notes are available on GitHub.

R. Amogh ramogh.com

CURRENT SUPPORT

Tez is in active development toward 1.1.0. It supports HTTP/1.0 and HTTP/1.1 on Linux and macOS.

TLS, authentication, HTTP/2, HTTP/3, compression, and persistent application storage are outside the current implementation.

Configuration and limits
Report an issue