gemini posts

Subscribe to just gemini posts via RSS.

Debugging My Gemini NWProtocolFramer Implementation

I recently ran into an issue with the Network.framework Gemini client I’d previously implemented that turned out to be somewhat perplexing. So, I thought I’d write a brief post about it in case anyone finds it interesting or helpful.

A UI Framework Dilemma

For the past couple of weeks I’ve been building Rocketeer, an iOS browser for the Gemini network.[1] The gemtext format is very minimal, so I thought it would be fairly easy to build something to render Gemini documents. The format is line-oriented and only allows a few different line types. There are regular paragraphs, link lines, 3 levels of headings, unordered list items, preformatted blocks, and block quotes. All of these are pretty simple, visually speaking, and the layout is also straightforward. So, I expected to be able to build a renderer quite easily. Unfortunately, there turned out to be lots of little details that were not so obvious at first and introduced a bunch of complications.

Implement a Gemini Protocol Client Using Network.framework

Gemini is a small protocol bulit on top of TCP and TLS that’s designed to serve as a transport mechanism primarily for text documents while lacking a great deal of the complexity of HTTP. Network.framework was introduced to Apple’s platforms in 2018 as a modern framework for dealing with network connections and building custom network protocols. So, let’s use it to build a Gemini client implementation.