I would like to see something like: althttpd -exec some_executable {}.method {}.body So you could quickly call executable from a browser and redirect the output in the response.
Althttpd: Simple webserver in a single C file
21–30 of 345 posts
Re: Althttpd: Simple webserver in a single C file
#22Here is the actual single C-code file: https://sqlite.org/althttpd/file?name=althttpd.c Something I absolutely love about text based protocols such as HTTP/1 is how easy you can implement it in any virtually programming language. Sure, the implementation is not top-of-the-notch, but it just damned works, it is portable, it is understandable by humans. That's something what's got lost with HTTP/2 and HTTP/3, respectiv…
HTTP is serious about backward compatibility, so a client that speaks HTTP/1.1 (or HTTP/1.0 + Host header) can still talk to most servers out there. Similarly, if you write a server that only speaks HTTP/1.1 (or HTTP/1.0 + Host header), you can put it behind a reverse proxy or load balancer that handles higher versions, does connection management, and terminates TLS. It will work perfectly fine, only without some of…
Re: Althttpd: Simple webserver in a single C file
#23I'd be putting this in 1000 layers of sandboxing since its a C program with network access.
Re: Althttpd: Simple webserver in a single C file
#24 /*
** Test procedure for ParseRfc822Date
*/
void TestParseRfc822Date(void){
time_t t1, t2;
for(t1=0; t1
There's only two billion integers, guess we can test them all. Well, substantially fewer than two billion with that skip. I wonder if that completes in a few seconds.Re: Althttpd: Simple webserver in a single C file
#25Also see: darkhttpd: https://github.com/emikulic/darkhttpd
I was not familiar with darkhttpd. Both of these are similar to the sqlite server in security design (chroot capability), but unlike in that a single process serves all requests and does not fork.
I have used stunnel in front of thttpd, and chrome has no complaints.
Re: Althttpd: Simple webserver in a single C file
#26/* ** Test procedure for ParseRfc822Date */ void TestParseRfc822Date(void){ time_t t1, t2; for(t1=0; t1 There's only two billion integers, guess we can test them all. Well, substantially fewer than two billion with that skip. I wonder if that completes in a few seconds.
Re: Althttpd: Simple webserver in a single C file
#27One file of 2600 lines, guess if you give up common sense and follow this approach you can even create a kernel in one file
Re: Althttpd: Simple webserver in a single C file
#28Interesting but why? There’s a bazillion web servers out there, surely one of them can do the job? What have I missed?
It also isn't brand new: it's been around since 2004. So that probably narrows the range of possible competitors even more.
If you can find a webserver that meets all of those constraints, please let us know.
Re: Althttpd: Simple webserver in a single C file
#29Re: Althttpd: Simple webserver in a single C file
#30Also see: darkhttpd: https://github.com/emikulic/darkhttpd
Similar is thttpd. I was not familiar with darkhttpd. Both of these are similar to the sqlite server in security design (chroot capability), but unlike in that a single process serves all requests and does not fork. I have used stunnel in front of thttpd, and chrome has no complaints. https://acme.com/software/thttpd/