Lurker News
This is ymawky, a static file web server for MacOS written entirely in ARM64 assembly. It supports GET, PUT, DELETE, HEAD, and OPTIONS requests, and supports Range: bytes=X-Y headers (which allows scrubbing for video streaming). It decodes percent-encoded URLs, strictly enforces docroot, serves custom error pages for any HTTP error response, supports directory listing, and has (some) mitigations against slowloris-like attacks.

I’ve also written a more detailed writeup here: https://imtomt.github.io/ymawky/

Comments (227) 57 threads

Show all comments

Showing thread 24 of 57

ksi231 reply#
What was the hardest part, Range header handling or the slowloris mitigations? Both seem like they'd be a nightmare without higher-level state machines.
imtomt1 reply#
slowloris mititgations actually weren't too bad, just a couple syscalls to setitimer(), sigaction(), and setsockopt(). Range header parsing was awful, so was content length. I'd say all in all, probably Range headers. Just string parsing in general is pretty awful in assembly.
ksi23#
Thanks for the insight. Yeah, hand - rolling string parsing in assembly sounds like a special kind of punishment. Great work getting through it.