Enhanced HTTPD - native HTTP 1.1 Livecode Socket Server

David Bovill david.bovill at gmail.com
Fri Mar 8 03:44:55 EST 2024

Hi Mike and Richard, the progress I’ve made is along the lines that Richard
speaks to in the thread. I have added a little to the earlier work and
bundled socket based servers - mainly by making it easy to add and remove
logging with before and after handlers, and layers of back scripts that
allow you to add your own custom middleware.

There are a few things holding me back from plunging in further and
finishing the work. Firstly, as Richard says  still a way to go to add
things like HTTP 206 partial content support, and there are already robust
libraries in other languages out there - so the strategy of integrating
Livecode with one of these is also attractive given the amount of effort
required it’s a question in my head as too which route would be better

I also have quite a nice integration with local node servers, which took
quite a lot of tweaking as simply using shell() didn’t cut it - but now
works well. However with this approach I don’t get the control I need from
the Livecode side.

There are also issues with socket requests and timeouts which would need to
be debugged and while that is not a problem in itself, the underlying
concern I’d have is that at the end of the process I’d find that the cause
was a Livecode bug and not something in my code. There would be little I
could do in that case other than hope and wait.

Funny you came across the Full Moon Happening event as I’m currently
working on a new version of that early experiment for March 25th this year
(a full moon, penumbral lunar eclipse and wikis birthday - should be fun.
If anyone’s in London this Friday March 15th, I’ll be doing an event at the
RSA in the afternoon and Newspeak House in the evening where we’ll go into
this in more detail.

On Wed, 28 Feb 2024 at 13:55, Mike Kerner via use-livecode <
use-livecode at lists.runrev.com> wrote:

> just pinging to see if anything more has happened on this
> and the how list is really quiet
> On Tue, Feb 6, 2024 at 11:09 PM ambassador--- via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> > 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
> >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>    and did a little diving.
> And God said, "This is good."
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

More information about the use-livecode mailing list