Re:Althttpd: Simple webserver in a single C file
by daitangio on Tuesday June 08, 2021 @08:33AM
(#27434275)
Yes and no.
Debugging a binary protocol is a bit more difficult then a text one; which is the reason HTTP is ascii based.
[ Parent
| on HN ]
Re:Althttpd: Simple webserver in a single C file
by zaarn on Tuesday June 08, 2021 @08:44AM
(#27434387)
The reason HTTP is ASCII based isn't because it's easier to debug. It's because back then the other end was as likely to be a human as a piece of software. Because HTTP in it's early days barely had headers or even formatting, so people typed "GET /" at the server directly or used the same method to send mail directly.
Nobody does that anymore and debugging is easily solved by converting your binary protocol to a textual form.
Re:Althttpd: Simple webserver in a single C file
by throw0101a on Tuesday June 08, 2021 @09:11AM
(#27434676)
I question the ascertain that humans were doing "GET /" or "HELO my.fq.dn" on any regular basis. There were mail clients from the very beginning for example:
* https://en.wikipedia.org/wiki/History_of_email
Perusing document-based information was also done via clients, first with Gopher and then with the WWW: either GUIs like Mosaic, or on the CLI via (e.g.) Lynx.
Re:Althttpd: Simple webserver in a single C file
by michaelmior on Tuesday June 08, 2021 @09:26AM
(#27434842)
I definitely did back in the day :) But I'm only one single human.
Re:Althttpd: Simple webserver in a single C file
by lmilcin on Tuesday June 08, 2021 @09:51AM
(#27435189)
I did both send mails over SMTP as well as downloading files from FTP using Telnet.
Re:Althttpd: Simple webserver in a single C file
by jbverschoor on Tuesday June 08, 2021 @12:13PM
(#27437107)
same
Re:Althttpd: Simple webserver in a single C file
by zaarn on Tuesday June 08, 2021 @09:16AM
(#27434733)
I would question if this weren't the case often enough that people would demand it be compatible with their teleprompter.
Re:Althttpd: Simple webserver in a single C file
by choeger on Tuesday June 08, 2021 @10:31AM
(#27435673)
I don't think this is about human readability (albeit it might be to some extent during the design phase). Instead, I think this was the sensible thing to do when byte order was way more variable across a network. If you only send single bytes to begin with, you can as well use a textual format, IMO.
Re:Althttpd: Simple webserver in a single C file
by squarefoot on Tuesday June 08, 2021 @11:54AM
(#27436807)
It depends from the nature of the payload. If I have to send text, I'll use a text based protocol because I can debug it more easily, but if I have to send binary information, I'd rather send it using well defined structures after taking into account word sizes, alignment, endianess etc. on the involved hardware. Back in the day I had to do that with small agents on different achitectures (IBM Power and x86) with different languages (C and Object Pascal), and the correct textbook way to do that was to use xml, but that way everything had to be converted to text, interpreted and then translated back for replies. No way, hardware was slow and we aimed at speed, so we used plain C/Pascal structures and no other manipulation except for adjusting type sizes and endianess if the hardware or language required so to make all modules compatible no matter what they were written in and where they would run. I also built my own tools for testing and debugging which were nothing more than agents that sent predefined packets and echoed at screen the return values, so that any error in the data would be quickly spotted, while a xml translation of a corrupt buffer could have missed any error not comprised in the marked text, hence hiding there was a problem somewhere.
A solution like that is highly debatable for sure, but I'm among the ones who want their software to crash loudly at the first problem, not try hiding it until it creates a bigger damage.
Re:Althttpd: Simple webserver in a single C file
by Iwan-Zotow on Tuesday June 08, 2021 @09:57AM
(#27435277)
> which is the reason HTTP is ascii based.
well, other side of HTTP was telnet in the terminal - this is why it is ASCII to begin with
Re:Althttpd: Simple webserver in a single C file
by tdeck on Tuesday June 08, 2021 @01:53PM
(#27438538)
This is not true. HTTP was developed for the first (graphical) web browser, WorldWideWeb. It was specifically intended to serve HTML and images, neither of which is particularly well suited for browsing with telnet.
Re:Althttpd: Simple webserver in a single C file
by eloop on Wednesday June 09, 2021 @12:14AM
(#27444155)
Not sure that is strictly correct. I vaguely remember a command line browser early in the piece. The inline image ability and <img> tag came a bit later in the story when Andreessen put it into the NCSA's Mosaic browser. I've always wondered if it was that single thing that really made the web take off, more so than hyperlinking which had been around for quite a while. People like pretty pictures, especially advertisers.
Re:Althttpd: Simple webserver in a single C file
by tdeck on Wednesday June 09, 2021 @12:57PM
(#27450257)
You're describing the line mode browser:
https://en.wikipedia.org/wiki/Line_Mode_Browser
But that didn't just spit out the HTTP response - it parsed and rendered the HTML.