-- Leo's gemini proxy
-- Connecting to ainent.xyz:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini; charset=utf-8; lang=en
This is the third in a planned series of posts (well, fourth if you count the announcement) where I'll share my experience writing smolver, my Gemini server software, written in Swift.
You can find the previous iterations here:
Depending on how long this series becomes, I may end up creating a dedicated page for them all.
Somewhere along the line, my 'alpha x' versioning in the backlog and this gemlog got out of sync with my git tags. Git will tell you smolver is at v0.0.14, but I've just recently finished up alpha 5 on my backlog. If I recall correctly, I started putting code into production and tagging it before I started my planned backlog, including bugfixes / tweaks.
As I'm reviewing the git diff, I remember that I've forgotten to add release notes into the tags since then.
These changes are not necessarily listed in the order in which they were implemented:
Enhanced socket server framework to allow writing arbitrary strings and data to a connection, allowing smolver to send an actual response body along with the header
Fixed bug in existing implementation where the text of posts were sent to the client in the response header, instead of the body
Renamed the `App` `struct` to `Router`, as I mused on in the previous post
Included MIME type in responses
Fixed bug where anything after <CR><LF> in a request wouldn't get ignored if that sequence appeared more than once
Overhauled the `Response` struct so that now *every* status code in the Gemini spec is accounted for, though not necessarily being utilized just yet
Removed unnecessary redirect to `index.gmi` when requesting capsule root, instead of just serving that file directly
Added support for serving `.gemini` files
Added support for serving arbitrary file downloads, currently using a small subset of common MIME types
If requesting a directory and that directory contains an `index.[gmi|gemini]`, serve that file instead of returning an error
Rethought planned design for configuring smolver -- now planning to do via a `json` file instead of `ini`, for now at least. JSON parsing comes out of the box in Swift, so that'll be a big time saver.
Other minor backlog tweaks
Currently, the following MIME types are supported and auto-detected via file extension:
application/octet-stream
application/atom+xml
application/x-gtar-compressed
application/pdf
application/x-shellscript
image/png
image/jpeg
text/gemini
text/markdown
text/plain
text/x-python
I also added arbitrary configuration of new MIME types to the backlog.
This ended up being much shorter than I anticipated, but I think smolver is coming along nicely.
Stay tuned for more.
-- Response ended
-- Page fetched on Tue May 21 09:40:53 2024