[ANN] Tiny ad-hoc server

Hello!

I don't understand how the infinite while works in this case...
Is it consuming cpu all the time?

I play once with ncat and the program was rather in two parts:

1: the-worker
#!/bin/sh
printf "20 text/gemini; charset=utf-8\r\n"
printf "Page generated: %s\n\n" "$(date)"
cat file-to-serve

2: the-listener
#!/bin/sh

port="1965"
cert="cert.pem"
key="key.pem"

printf "Starting gemini server on port %s...\n" "$port"
ncat --ssl --ssl-cert "$cert" --ssl-key "$key" --listen "$port" -k -c ./the-worker

freD.


??????? Original Message ???????
On Friday 19 June 2020 19:28, James Tomasino <tomasino at lavabit.com> wrote:

&gt; I put up a tiny experiment of an ad-hoc server over on 
gemini://tomasino.org. The code for the server is on that gemini page for 
you to inspect and play with. Credit to xq for the concept. It's trivial 
to implement and may open the door for some folks who don't have a plan of 
running a big server. It may even be able to work with solderpunk's 
micro-instance ideas. I'm not sure if there's a way to validate client 
certs by building on to it, but that would make for easy micro-services.
&gt;
&gt; -   tomasino

</tomasino at lavabit.com>

---

Previous in thread (2 of 6): 🗣️ Blair Vidakovich (vidak (a) riseup.net)

Next in thread (4 of 6): 🗣️ James Tomasino (tomasino (a) lavabit.com)

View entire thread.