opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

A minimal web-server written in assembly
GitHub RepoImpressions130

Project Description

View on GitHub

Relayouter: A Lightning-Fast HTTP Server Written in Assembly

Ever wondered how fast a web server could be if you stripped away all the abstractions and wrote it in raw assembly? Meet Relayouter—a minimal, multi-process HTTP server that’s built entirely in x86-64 assembly using FASM. No libc, no bloat, just pure speed.

This isn’t just a proof of concept—it’s a functional server that handles static files, uses epoll for non-blocking I/O, and parallelizes across CPU cores. If you’ve ever wanted to see how close to the metal you can take a web server, this is it.

What It Does

Relayouter is a tiny (~5.3 KiB) nginx-like server that:

  • Serves static files from a ./public directory.
  • Spawns multiple processes (one per CPU core) for parallelism.
  • Uses raw Linux syscalls—no external dependencies.
  • Handles URL decoding and MIME type detection.

It’s designed to be as lean as possible while still being practical for local development or lightweight hosting.

Why It’s Cool

  1. Raw Performance: By skipping libc and writing directly in assembly, Relayouter minimizes overhead.
  2. Multi-Process Architecture: Unlike single-threaded servers, it scales across CPU cores.
  3. epoll for Efficiency: Uses Linux’s epoll syscall for high-performance I/O multiplexing.
  4. Educational Value: A great codebase to study if you’re curious about low-level networking or syscalls.

That said, the author notes it’s not production-ready yet—there are bugs, and it’s "very easily exploitable." But for tinkering or learning? Perfect.

How to Try It

git clone https://github.com/peachey2k2/relayouter.git
cd relayouter
make build  # Compile the server
make run    # Start it (listens on http://localhost:8080)

Drop files into ./public, and they’ll be served instantly.

Final Thoughts

Relayouter is a fascinating project—not because you should replace nginx with it, but because it shows how much you can do with so little. It’s a reminder of what’s possible when you ditch abstractions and embrace the bare metal.

If you’re into systems programming, give it a look. And if you’re brave, maybe even contribute to the todo list (edge-triggered epoll, anyone?).


Follow @githubprojects for more cool projects.

Back to Projects
Project ID: 1953113485598130687Last updated: August 6, 2025 at 03:18 PM