@mikemccabe @b0rk My thinger is at a higher layer than what @b0rk is suggesting. Specifically, I use the HTTP* stuff provided by Node.
(That said, many years ago I _did_ build a simple HTTP server from scratch, in Java. Like around 1999 or 2000 maybe? I wouldn't recommend using it at this point!)
@b0rk bonus points for the client being telnet.
A university project was to implement rfc2324 which was quite a good demo of making an "http" server. We were awarded bonus points if our client could talk to other servers. Or vice versa.
@b0rk These things are super to understand that you could do it yourself :)
And how things actually work behind the scenes.
On http I am personally annoyed by the referer header spelling, that wasted some hours in the day.
Thanks for your work and hints to interesting things.
@b0rk I loved this post when I saw it which is kind of the same thing so, yeah, I think is an awesome idea
@b0rk is this a good time to mention that https://txt.friday.horse is written in awk, only proxied to get ssl but actual HTTP in gnu awk.
The simplicity of HTTP 1 for like 80% of the features is so fun and convenient... I think exposing more people to that is a great idea
@b0rk @codefolio has a WIP book that goes down this road, but in Ruby, though, as I understand it, it goes a little further beyond a weekend.
The more the merrier!
@sakiamu @b0rk Yup, I have a book on that (https://rebuilding-http.com). But as you say, the more the merrier!
And yeah, you could totally get to a basic one in a weekend.
And yeah, Ruby not Python, so only sort of the same audience π
@b0rk yes, I'd be super interested.
Your "you can just send a hand written GET using netcat" example was super helpful in making HTTP much more accessible and easy to reason about for me
@msokolov @b0rk Gzip is a higher-level concern (transfer encoding is pretty high-level), as is MIME anything. Keep-alive is easy enough even with HTTP 1.0 v. 1.1 differences. (1.1 just makes it the default.) Chunked encoding is the low level side of this, especially as everyone forgets HTTP header "trailers". (Sending headers at the end of a chunked transfer, not the start. Useful for generating Content-MD5 and such on the fly.) POST is just a verb.
I've linked my hybrid HTTP service before. π
@b0rk Heh, I wrote the worst βserverβ imaginable in portable shell printf & netcat as an integration test subject for HTTP nagios plug-ins years ago.
I expect to be amazed with what ~100 lines of clear python can deliver.
@b0rk This is the magic weekend stuff where you wake up the next day and find out that 20 years of maintenance have gone by.
But Iβd prefer to encounter your toy versions in production to other copy&pastes.π