A tiny HTTP/1.0 static file server with explicit platform backends.
No HTTP framework. No server library. No hidden runtime layer.
DEADWIRE HTTPD v1.0.0 STABLEThe v1.0.0 target is the stable static-file core across Windows, Linux, and macOS.
DEADWIRE is intentionally small. It is not a TLS server, not an async framework, and not an internet-facing daemon.
Windows -> WinSock2 + Kernel32 backend
Linux -> raw Linux syscall backend
macOS -> POSIX socket backendThe Makefile selects the backend automatically:
Windows_NT -> build/deadwire.exe
Linux -> build/deadwire
Darwin -> build/deadwireDEADWIRE does one narrow job:
- bind
127.0.0.1:18080by default - accept an optional port argument:
deadwire 19090 - accept an optional bind argument:
deadwire 19091 127.0.0.1 - accept
0.0.0.0when explicitly requested - accept blocking TCP clients
- parse
GET <path> HTTP/... - parse
HEAD <path> HTTP/... - serve files from
public/ - render
/aspublic/index.html - return
/health - emit explicit
Content-TypeandContent-Length - detect MIME for
.html,.htm,.txt,.css,.js, and.svg - print small structured request trace lines to stdout
- reject unsupported methods with
405 - reject path traversal with
403 - reject raw
%paths until percent-decoding exists - return missing files with
404 - close the connection after every response
Example request trace lines:
access status=200 route=static
access status=200 route=/health
access status=405 reason=method
access status=403 reason=forbidden
access status=404 reason=not-foundUse a Windows toolchain that provides:
make- GNU assembler:
as gccfor PE/COFF linking- PowerShell
make clean
make doctor
make verify
make runManual tests:
build\deadwire.exe
curl.exe http://127.0.0.1:18080/health
build\deadwire.exe 19090
curl.exe http://127.0.0.1:19090/health
build\deadwire.exe 19091 127.0.0.1
curl.exe -I http://127.0.0.1:19091/healthUse Linux with:
make- GNU assembler:
as - GNU linker:
ld curlfor verification
make clean
make doctor
make verify
make runUse macOS with:
make- C compiler:
cc curlfor verification
make clean
make doctor
make verify
make runThe macOS backend is intentionally direct POSIX socket code. It exists to make v1.0.0 tri-platform without pretending that Darwin uses the Linux syscall ABI.
make verifyVerification checks:
/healthreturnsdeadwire: ok/returnsContent-Type: text/html; charset=utf-8/hello.txtreturnsContent-Type: text/plain; charset=utf-8/style.cssreturnsContent-Type: text/css; charset=utf-8HEAD /healthreturns headers without a body where that backend supports the v1 request pathPOST /returns405- traversal attempts return
403 - a missing file returns
404 - structured request trace lines are emitted
- custom port works
- explicit loopback bind works
- explicit any-address bind works
- bad argument cases exit with
fatal: bad arg - generated Windows source contains expected release markers
- single-threaded blocking I/O
- HTTP/1.0 response style
- no TLS
- no keep-alive
- no chunked encoding
- no percent-decoding yet
- max request buffer: 4096 bytes
- max served file size: 65536 bytes
- Windows argument support is generated at build time
v0.1.0 initial native server
v0.2.0 port arg
v0.3.0 bind arg
v0.4.0 log shape
v0.5.0 HEAD request
v0.6.0 any bind
v0.7.0 bad arg verify
v0.8.0 preflight verify
v0.9.0 release polish
v1.0.0 stable tri-platform coreLinux path:
socket -> bind -> listen -> accept -> read -> parse -> openat -> read -> write -> closeWindows path:
WSAStartup -> socket -> setsockopt -> bind -> listen -> accept -> recv -> parse -> CreateFileA -> ReadFile -> send -> closesocketmacOS path:
socket -> setsockopt -> bind -> listen -> accept -> recv -> parse -> fopen -> fread -> send -> closeEvery platform boundary is explicit.