Enhanced HTTPD - native HTTP 1.1 Livecode Socket Server

ambassador at fourthworld.com ambassador at fourthworld.com
Tue Feb 6 23:02:53 EST 2024


David Bovill wrote:

> I've been working for a while on a native server written in Livecode
> using sockets. I feel it is definitely something that is sorely needed
> - but to do it properly is more work that I initially thought. I need
> to add HTTP 206 partial content support -
> https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206. I expect
> there to be other things that will need to be added.
> 
> Is anyone interested / need this? Or does anyone already have something
> they use?


MC shipped with a simple HTTPd example included, and many years ago back when Pierre was still active here I dusted it off to add support for HTTP 1.1 so it would work with modern browsers:

https://fourthworld.net/lc/mchttpd-4W.zip

It's been years since I touched it, and IIRC the only other change I made was to use callbacks for both ends of the network I/O (for some reason Raney had used callbacks only on one side, tho I can't recall if his was on the write or read end). Callbacks for net I/O help a lot.

If you're already far enough down the road to be thinking of 206 errors, there's likely nothing here you haven't already written.  But as an example (slightly updated) of the sort of thing that used to ship with old versions to encourage exploration of network apps, it may be a fun trip down memory lane.


A question, if interesting to answer: one of the reasons I set this aside was the beginning of a process of moving away from my own homegrown tools for generic commodities like socket servers.  Apache and Node cover most of what I've needed since, and I don't have to maintain them, so I can focus on the stuff specific to my app.  What are you working on these days? I stumbled across your chat with Ward Cunningham in the Full Moon Happening just a few months ago; good stuff. Curious if your interest in decentralization is still a focus, and whether it also includes things like IPSF and blockchains.  Maybe offlist if it's not too LiveCodey is fine.


Richard Gaskin
FourthWorld.com



More information about the use-livecode mailing list