Viltrum: I Wrote My Own HTTP Engine in V

4 min read vlang viltrum http web-framework systems open-source v

I have RustAPI. 55+ stars, MCP, a production path. One framework is enough, right?

Nope. Not for me, anyway.

In July 2026 I was poking around with V. While I was looking for something to build, the answer got clear: not something Axum-flavored. A thin HTTP framework with its own accept loop, its own parsing, its own keep-alive. I named it Viltrum.

Why V?

Few people take V seriously. High star count, debatable production claims, thin ecosystem. That's exactly why it fits a side project.

My rules are simple:

  1. Don't touch RustAPI. That's a separate world.
  2. Limited hours per week. Don't let the other work die.
  3. A single binary, readable code, and that "the engine is mine" feeling.

V gives me that. v run is fast. The stdlib has net. There's veb, but I didn't want to wrap veb. I wanted the stack to be mine, from framed TCP up to the HTTP/1.1 message.

A learning project? Yes. A toy? No, I won't call it a toy. Because parse edge cases, keep-alive, the mandatory Host header, the 413 path... that's not "hello world". That's an engine.

What I built (short version)

The flow goes like this:

TCP accept
  -> multi-read until end of headers
  -> Content-Length body
  -> parse
  -> router (:param)
  -> middleware
  -> response
  -> keep-alive or close

v0.1: PoC. It worked, single buffer, Connection: close.

v0.2: Real framing. Keep-alive, path params, a rest example (in-memory TODO JSON).

v0.2.1: Polish. Query decoding, trailing slash, options, CI.

v0.3: Graceful shutdown on SIGINT/SIGTERM, keep-alive idle timeout, recover middleware, timing in the logger.

The public API is small on purpose:

mut app := viltrum.new()
app.use(viltrum.recover)
app.use(viltrum.logger)
app.get('/hi/:name', hello)
app.listen('127.0.0.1:8080') or { panic(err) }

Handlers are plain functions. No extractor magic. No type-level magic. I got tired of that side of things; this one is deliberately plain.

The engine decision

Some people ask "why not the stdlib's net.http.server?" Answer: learning and control.

Writing a server is two jobs:

  1. Framing. Getting HTTP messages out of a byte stream. Incomplete headers, half a body, leftover buffer, keep-alive.
  2. Application surface. Routes, middleware, JSON helpers.

Most frameworks polish 2 and leave 1 to someone else. I wanted to write 1 myself. Because on the RustAPI side the "engine" debate keeps coming up too. Trying it at small scale in V is cheap.

To be honest: the V runtime has no Go-style panic recover. My recover middleware hardens the response (status 0, missing Content-Length). It doesn't magically catch a panic that takes down the process. I wrote that in the CHANGELOG too. No exaggeration.

Relation to RustAPI

None. Zero.

I don't want to split two framework brands at the same time. RustAPI is the Rust world. Viltrum is a V experiment. There's neither a reason nor the time to merge them.

Viltrum isn't a money-making tool. It's a side track. Commits are under Tuntii, MIT, public.

Who would use it?

  • Someone learning V who wants "something real"
  • Someone writing a single-binary tool API
  • Someone curious about "what does a framework actually do?"

Who wouldn't?

  • Someone who wants TLS + HTTP/2 + WebSocket in prod tomorrow (not there yet, put a reverse proxy in front)
  • Someone looking for an ORM + auth suite (a deliberate non-goal)

Where are we?

Repo: github.com/Tuntii/viltrum

git clone https://github.com/Tuntii/viltrum.git
cd viltrum
mkdir -p ~/.vmodules && ln -sfn "$(pwd)" ~/.vmodules/viltrum
v run examples/hello
# another terminal
curl http://127.0.0.1:8080/hi/tunay

examples/rest is a small TODO JSON API. It dogfoods keep-alive and the body path.

Next up: getting the bench numbers properly settled, more parse fuzzing, maybe route groups. No HTTP/2. No TLS. Good thing, too; keeps the focus from scattering.

Wrapping up

The best way to try a new language isn't "finishing the tutorial". It's writing a small but real system. An HTTP engine is exactly that: clear boundaries, fast feedback, hard to lie to yourself.

That's exactly what Viltrum is. I talked to V, wrote the engine, shipped it.

If you don't like it, open an issue. If you do, no obligation to star it; fork it and break it. That's where the real fun is.

← Blog