Manny S.

httpserver

WIP

HTTP/1.1 server in Rust on raw Linux syscalls, no std::net and no libc

Why

Wanted to see what's under TcpListener::bind, so every socket call is a syscall instruction in inline asm.

How it works

socket, bind, listen, accept, sendto, setsockopt and the rest are wrapped by hand, and negative returns become an Errno enum. An accept loop serves one connection at a time and closes every fd. Requests are parsed from the whole buffer after each read, so a request split across reads parses the same as one that arrives at once. It follows RFC 9112 on the parts that matter for safety, like rejecting conflicting Content-Length headers. Tests use real sockets, including 200 connections with no fd leak.

Next

Next is static files, keep-alive, then threads and epoll, then a benchmark against std::net.