revHHTP
Richard Gaskin
ambassador at fourthworld.com
Sun Nov 2 11:55:09 EST 2014
Todd Geist wrote:
> I am looking for a copy of the http server written in LiveCode.
> it was called revHTTP, and before that it was mcHTTP
>
> anyone have a copy?
There have been a few floating around over the years. The first was
made by Dr. Raney himself as a way of demonstrating robust socket
communications, posted at metacard.com as mchttd.mc back before the turn
of the century.
Fun as it was when it first came out, over time browsers have become
more strict in what they expect in HTTP headers, so that original stack
no longer works as-is.
Several years ago Andre Garzia wrote a much-expanded version of that,
which may be the one you're referring to. If it's still around it may
be at his site, but I don't believe it's maintained any longer, and
Andre recommends using Apache and NginX for serious development.
Given that LiveCode doesn't yet support threading, I generally agree
with Andre: Apache does a good job of juggling multiple simultaneous
requests by spawning new instances of itself, and spawning new instances
of any CGIs it may use, like LiveCode Server. This sort of parallelism
through multi-processing is important in a production environment where
simultaneous requests are inevitable and cannot afford to be queued.
However, not every useful environment is for production of
publicly-accessible works. :)
I have a VPS and a local server I use only for distributed processing
and exploratory development, and along with other tools (I may be able
to share my LiveHive project within a few weeks; more on that later),
while most of my communications with those machines is through SSH
(sharing keys opens up so many interesting LiveCode opportunities with
unusually strong security) I've sometimes found it handy to have an HTTP
interface available on those systems for private purposes where I or one
of my automated systems are the only users.
In those cases. mchttpd.mc would be useful if only it output proper
headers. So with Andre's permission I backported his header function to
mchttpd.mc, and have posted it to my site under a new name to
distinguish the revision:
<http://www.fourthworld.net/lc/mchttpd-4W.zip>
You're welcome to use it, modify it, and share it. I've discussed the
revised version with Dr. Raney and at his request it's available under
MIT license.
Since LiveCode is single-threaded, the range of applicable use-cases as
a socket daemon is limited. It will never bee Apache, and Apache is so
useful and flexible, and has such a vast supporting ecosystem of
learning materials and extensions, it's rare that we truly need anything
else.
Moreover, LiveCode Server as a CGI under Apache is a great way to get
the best of what each brings to the table. Multi-processing may carry a
bit more overhead than multi-threading but not as much as one might
think, and is so absolutely discrete that it's much easier to code for,
and in some contexts more secure.
In fact, the overhead with LC is roughly on par in my testing with
similar use of PHP, Python, or other scripting engines. And given that
we can so easily make purpose-built stuff I find many instances where
LiveCode Server-based solutions are more scalable than similar but much
more generalized (hence larger) PHP-based systems like Drupal or Joomla.
All that said, you have an adventurous mind and there's no telling what
you're up to. :) The updated mchttpd may be a good fit. I'd be
interested in hearing what you wind up doing with it.
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list