Created 2022-06-03. Updated 2022-11-23
Client to download a file:
example.com /files/about.txt 0
Server response:
2 text/plain; charset=utf-8 In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare...
I wanted to play around with the Spartan protocol. To that end, I bodged together a simple server written in Go.
It weighs in at 114 lines. It isn't complete, or pretty. The code is in the link below.
No doubt that there are security improvements to be made. Just tweaks the constants at the top of the file to suit your tastes. I use the FreeBSD packet filter (pf) to forward from port 300 to 3000.
I haven't set up a server permanently, so I've not got anything for you to poke around with.
My plan is that it will also server gopher content. Gemini content, too, if I can figure out how to get server-side TLS working.
I also have in mind the idea of using groff server-side. That way I'd be able to do stuff like have text that is short, but is reformatted nicely for the different protocols. Automatically-aligned text on gopher would be a neat feature, for example.
Create file: /usr/local/etc/rc.d
Edit rc.conf to include the line: sss_enable="YES"