Building a web server in aarch64 assembly to give my life (a lack of) meaning
a day ago
- #assembly
- #aarch64
- #web-server
- ymawky is a static HTTP web server written in aarch64 assembly for macOS, using raw Darwin syscalls without libc wrappers.
- It supports HTTP methods like GET, HEAD, PUT, OPTIONS, DELETE, byte ranges, directory listing, and custom error pages.
- The server is fork-on-request, handling each connection in a separate process, which simplifies memory isolation but limits concurrency.
- Key challenges include manual HTTP parsing, path normalization, percent-decoding, and handling edge cases like slowloris attacks.
- Security measures include docroot enforcement, symlink handling via O_NOFOLLOW_ANY, timeouts, and limits on max body size and connections.
- Apple-specific features like proc_info() are used for child process counting, and sigaction() with custom trampolines manages timeouts.
- The project emphasizes learning low-level details, with constraints like no external libraries, preexisting parsers, or high-level abstractions.