The HTTP handler no longer works; browsers complain connection reset.

I've investigated, but without success.
This commit is contained in:
Simon Brooke 2025-08-30 11:26:18 +01:00
parent e1b3addcdd
commit a4bcf3c378
7 changed files with 130 additions and 5 deletions

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<title>404: File not found</title>
<style>
a {
background-color: black;
color: greenyellow;
}
body {
padding: 2em 20%;
background-color: black;
color: green;
font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<h1>404: I'm sorry, Dave, I can't do that</h1>
<p>The file you requested was not found on this server.</p>
<footer>
<a href="https://git.journeyman.cc/simon/gild">The Generic Internet Listener Daemon</a>, Copyright: (c) Simon Brooke 1997
</footer>
</body>
</html>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<title>501: Not implemented</title>
<style>
a {
background-color: black;
color: greenyellow;
}
body {
padding: 2em 20%;
background-color: black;
color: green;
font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<h1>501: I'm sorry, Dave, I can't do that</h1>
<p>The GILD HTTP handler is very simple, and can only handle HEAD and GET requests.</p>
<footer>
<a href="https://git.journeyman.cc/simon/gild">The Generic Internet Listener Daemon</a>, Copyright: (c) Simon Brooke 1997
</footer>
</body>
</html>

View file

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome to the GILD HTTP handler</title>
<style>
a {
background-color: black;
color: greenyellow;
}
body {
padding: 2em 20%;
background-color: black;
color: green;
font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<h1 id="user-content-gild" dir="auto">GILD</h1>
<h2 id="user-content-the-generic-internet-listener-daemon" dir="auto">The Generic Internet Listener Daemon</h2>
<p dir="auto">This is ancient history, and never was meant for doing anything practical; it&#39;s essentially
a joke. Its practical use - when it had any practical use - was to experiment with new
protocols.</p>
<p dir="auto">The fact that protocols can be implemented in more or less any language you like is an added
jape: see HTTP in under 100 lines of shell script.</p>
<p dir="auto">Enjoy!</p>
<h2 id="user-content-building" dir="auto">Building</h2>
<pre><code>pushd src; make clean; make; popd
</code></pre>
<h2 id="user-content-running" dir="auto">Running</h2>
<p dir="auto">It depends what you want to do with it. Review the contents of <code>gild.conf</code>; in practice
only the HTTP handler is going to work out of the box, and, out of the box, it expects to find the website to
serve in <code>/usr/local/etc/gild/httpd/htdocs</code>. To change where it looks for its website, edit the HTTP
handler.</p>
<p dir="auto">The HTTP handler will serve HTML files, plain text files and common image formats, but nothing more
sophisticated. It currently won&#39;t serve CSS correctly (although your browser will probably cope) because it
can&#39;t tell the difference between CSS and plain text.</p>
<p dir="auto">Having said all that, to run it,</p>
<pre><code>bin/gild -f gild.conf
</code></pre>
<p dir="auto">will start <code>gild</code> listening on its default port, 8421. If you&#39;d prefer it to listen on,
for example, port 6666, you would use</p>
<pre><code>bin/gild -f gild.conf -p 6666
</code></pre>
<p dir="auto"><em>Be aware that gild is a true daemon</em>. It will immediately detach from the console, and you
will get your prompt back as if nothing had happened. But if you look in the syslog, you&#39;ll see something
like this:</p>
<pre><code>Mar 8 19:05:25 fletcher gild: Loading configuration from gild.conf
Mar 8 19:05:25 fletcher gild: registering handler [handlers/http] for protocol http
Mar 8 19:05:25 fletcher gild: registering handler [handlers/crp] for protocol crp
Mar 8 19:05:25 fletcher gild: registering handler [handlers/mdlscp] for protocol mdlscp
Mar 8 19:05:25 fletcher gild: started; awaiting requests on port 6666
Mar 8 19:06:14 fletcher gild: using handler &#39;handlers/http&#39; [28001] to handle http request from 127.0.0.1
</code></pre>
<p dir="auto">Back in the day, <code>gild</code> really did run a public website for several years. However, back in
the day, the internet was a much less hostile and dangerous place. <em>It is not at all security hardened</em>.
If you&#39;re going to run it on a public network, do it on a Raspberry Pi or something of that nature which has
nothing you value on it, and keep a close eye on what happens.</p>
<h2 id="user-content-using" dir="auto">Using</h2>
<p dir="auto">If you have a bright idea for a completely new application layer protocol, <code>gild</code> is a good
tool for prototyping, because it&#39;s absurdly easy to get things working. Apart from that, I strongly advise
you to treat it as an amusing curiousity, only.</p>
<h2 id="user-content-license" dir="auto">License</h2>
<p dir="auto">GPL version 2. You never were going to use this for anything commercial, seriously.</p>
</body>
</html>

View file

View file

View file

@ -28,8 +28,9 @@ clean:
rm -f core $(COMPONENTS) $(TARGETS) rm -f core $(COMPONENTS) $(TARGETS)
install: $(TARGETS) install: $(TARGETS)
install --strip $(TARGETS) $(HOMEDIR) test -d $(HOMEDIR) || mkdir -p $(HOMEDIR)
install gild.conf $(HOMEDIR) install -v --strip $(TARGETS) $(HOMEDIR)
cd handlers; make install install -v ../gild.conf $(HOMEDIR)
cp -r ../resources/httpd $(HOMEDIR)
cp -r ../handlers $(HOMEDIR)

View file

@ -86,7 +86,7 @@ void wrapper( int conversation, char * client_id)
/* ...execute the command (shouldn't return) */ /* ...execute the command (shouldn't return) */
{ /* if it did we've got an error */ { /* if it did we've got an error */
sprintf( errorBuff, sprintf( errorBuff,
"error [errno %d] whislt execing handler '%s' [%d]\n", "error [errno %d] whilst execing handler '%s' [%d]\n",
errno, command->command, ( int)getpid()), errno, command->command, ( int)getpid()),
error( LOG_ERR); error( LOG_ERR);
} }