3 ms·
Here's a 2000 line web server I wrote in C (with a focus on readability) which runs https://ipv4.games/ https://ipv4.games/ You can read the code at https://git
by jart 4y ago
Here's a 2000 line web server I wrote in C (with a focus on readability) which runs https://ipv4.games/ https://ipv4.games/ You can read the code at https://github.com/jart/cosmopolitan/blob/master/net/turfwar/turfwar.c https://github.com/jart/cosmopolitan/blob/master/net/turfwar... This web server runs on a single VM. It was handling about 300 write requests per second earlier today. You can monitor its metrics here: https://ipv4.games/statusz https://ipv4.games/statusz It uses *NSYNC as its multi-threaded locking primitives, which was designed by the guy who created Google's lock server. This service is frequently targeted by hackers so you can learn a lot about things like DDOS protection by reading the source.