HeadlinesBriefing favicon HeadlinesBriefing.com

ymawky: ARM64 Assembly Web Server Adds CGI and Linux Port

Hacker News •
×

ymawky, a web server written entirely in ARM64 assembly, moves beyond its macOS roots with a full Linux port. The project, originally a hobby, now supports CGI scripting, allowing dynamic content through query strings and POST requests to CGI resources. The server stays syscall‑only, forking per connection without a libc overlay on a 64‑bit architecture for developers exploring low‑level performance.

Building and running ymawky requires only gcc and binutils; a minimal www/ directory houses static files, while an err/ folder supplies custom error pages. The server listens on 127.0.0.1, defaulting to port 8080, though any numeric port is accepted. Debug mode disables forking, enabling single‑request handling for easier troubleshooting with tools like lldb and on the development machine for debugging.

ymawky enforces safety rules: it rejects paths over 4096 bytes, blocks traversal, and limits request size to 10 seconds, mitigating slow‑loris attacks. PUT uploads atomically write to temporary files before renaming, preventing partial writes. CGI scripts live in a cgi‑bin/ directory; the server sets QUERY_STRING and env vars, then forks and executes the script, relaying its output to the client.