SmolNetSharp - a C# client library for Gemini and Gopher
date: 14-Dec-2020
Fighting the platform gatekeepers
I've been having some problems over the last few months fighting with various Windows anti-virus products who have for unbeknownst reasons taken a dim view of some client software I wrote.
Specifically I created a simple command line Gopher client gopher-get which retrieves a gopher resource, using the Go client library by Prologic. But when compiled on Windows, the application seems to trigger all kinds of warnings by a number of the anti-virus and malware utilities. I already lost some hair over this.
Until recently, GemiNaut - my Windows Gemini GUI client in C# - was using this gopher command line client and gemget to do the actual network retrieval, but the time had come to implement a native C# client.
Luckily, InvisibleUp wrote another C# Gemini client, TwinPeaks, which included some useful Gemini C# classes. BoringCactus also contributed some ideas as well. So I've shamelessly started from that client code, and worked it up a bit, generalising to support Gopher too. But its become its own thing now and is cross-platform written in .NET Core.
SmolNetSharp
SmolNetSharp is a C# client library for writing your own smolnet clients (Gemini and Gopher). It does the heavy lifting of retrieving the content and setting up all the TLS code etc, handling the responses and redirects etc.
Include it in your project so you can get on with the fun stuff of building the user interface.
Key features
- Client code for Gemini and Gopher, using a common interface
- Option to set a timeout/max size to abandon long or large downloads
- Converts Gopher item types to mime types
- Support for Gemini proxies
- Compiles on Windows and Linux
There is a simple 100 line Gemini/Gopher simple demo interactive client in the repository, to illustrate usage.
Future goals
- Client side certificates
- Tasty TOFU
- Try out some alternative UI ideas for Gemini
GemiNaut release
I've already migrated GemiNaut to use it, and so there will be a new release of GemiNaut in the not too distant future.
One advantage is it is already faster, so the experience feels more fluid and instantaneous.
And hopefully there will be fewer complaints from the self-appointed platform gatekeepers 🙏
__________________ __________________ __________________