{"slug": "how-i-made-a-barebones-gemini-client-for-the-mini-micro", "title": "How I made a barebones Gemini client for the Mini Micro", "summary": "A developer built a barebones Gemini protocol client for Mini Micro, the MiniScript-based virtual computer, by pairing an in-Mini Micro client with a Python proxy of under 100 lines that translates HTTP requests into Gemini requests. Because Mini Micro lacks raw socket and TLS support, the proxy parses the Gemini URL from the HTTP path, performs the Gemini request, and returns a binary blob containing the canonical URL, status/meta header and body for the client to render. The implementation supports gemtext and images but lacks client certificates and server certificate pinning.", "body_md": "I recently read Joe Strout's article on [a multiplayer network starter for Mini Micro](https://dev.to/joestrout/a-multiplayer-network-starter-for-mini-micro-3kpa), and it reminded me of a project I finished up last month, so I figured I'd write that project up, in a similar style to my last dev.to article on [porting MiniScript to Cosmopolitan Libc](https://dev.to/minerobber9000/porting-miniscript-to-cosmopolitan-libc-4jp3).\n\nTo make the couple paragraphs I spent on MiniScript in my last article into one shorter one, MiniScript was invented by Joe Strout in 2016 and released in 2017 as a new beginner language for teaching kids how to code. MiniScript's language reference fits on [one side of a sheet of US Letter paper](https://miniscript.org/files/MiniScript-QuickRef.pdf) and [the reference for Mini Micro](https://miniscript.org/files/MiniMicro-CheatSheet.pdf), the \"killer app\" of MiniScript so to speak, only takes 3 more pages (the last page of that PDF being the one-pager for MiniScript itself).\n\nGemini, on the other hand, [describes itself as follows](https://geminiprotocol.net/):\n\nGemini is a new internet technology supporting an electronic library of interconnected text documents. That's not a new idea, but it's not old fashioned either. It's timeless, and deserves tools which treat it as a first class concept, not a vestigial corner case. Gemini isn't about innovation or disruption, it's about providing some respite for those who feel the internet has been disrupted enough already. We're not out to change the world or destroy other technologies. We are out to build a lightweight online space where documents are just documents, in the interests of every reader's privacy, attention and bandwidth.\n\nA request in Gemini is a URL followed by a CRLF--nothing more, nothing less. A response is a 2-digit status code, a \"meta\" line, and then the response body. It's a very simple protocol by design; there are no ways to track someone unless they want to be tracked--Gemini uses TLS client certificates for cases where you'd *want* to have an account-like system--and no ways to add such a system without breaking compatibility with older clients.\n\nA simple programming language, and a simple network protocol... seems like a match made in heaven!\n\nUsing a [simple proxy server](https://github.com/MineRobber9000/geminimicro/blob/trunk/proxy/proxy.py) alongside a [client running in Mini Micro](https://github.com/MineRobber9000/geminimicro/tree/trunk/minimicro), you can browse Gemini space using your Mini Micro. There *are* some limitations (only gemtext and images are properly displayed, there's no client certificate support nor server certificate pinning), but enough is implemented for a quick browse of basic Geminispace.\n\nWhen you type in a Gemini URL or follow a link, Mini Micro runs `startup.ms`-- the same file Mini Micro would naturally run on boot. This runs a small code snippet which requests the URL from the proxy server you run alongside it and then dispatches to another script which handles the specific response (displaying the response for `20`, or showing error screens for `4x`, `5x`, or `6x`).\n\nThe Gemini protocol is, as I said above, a simple protocol. It runs on raw sockets encrypted with TLS. Unfortunately, Mini Micro doesn't provide support for raw sockets, let alone wrapping them with TLS.\n\nWhat Mini Micro *does* support is synchronous HTTP requests. So the fix is simple: write a simple Python script to take HTTP requests and convert them to Gemini.\n\nThe proxy, implemented in less than 100 lines of code, parses the gemini URL from the HTTP request path, makes the Gemini request, and then returns to Mini Micro a binary blob containing the canonical URL, the Gemini header line (status and meta), and the body of the response.\n\nThe reason we have to return a binary blob with all of this data is because Mini Micro's HTTP support is admittedly quite limited. All it supports is retrieving some resource from a remote server, and all you get back in your program is either the resource (interpreted as Mini Micro sees fit), or `null`, if there was some error communicating between Mini Micro and the server. As such, the proxy returns the binary blob, which Mini Micro interprets as a `RawData`, an object specifically made for manipulating binary data, and we can parse the separate fields from it ourselves.\n\n`chrome://` URL in the cover image?\"\nThe `chrome://` pages don't actually trigger a request on the proxy; instead, they run a small MiniScript function, which either returns a local file (in the case of `chrome://homepage/*`) or does some extra logic  internally (in the case of `chrome://bookmarks/*`). This lets the internal logic stay the same; the same `utils.request` function gets called whether you're passing a Gemini URL or a `chrome://` URL, and the response from that function gets handled in the same way.\n\nThis also has the secondary benefit of not immediately dropping a new user into an error screen if they aren't running the proxy, since the homepage is implemented as a `chrome://` URL.\n\nTo be honest, in the grand scheme of things, it probably isn't. MiniScript is pretty niche, and so is Gemini. But for the handful of people who like both--like myself--it's neat to be able to combine them.", "url": "https://wpnews.pro/news/how-i-made-a-barebones-gemini-client-for-the-mini-micro", "canonical_source": "https://dev.to/minerobber9000/how-i-made-a-barebones-gemini-client-for-the-mini-micro-2h3p", "published_at": "2026-10-23 19:35:03+00:00", "updated_at": "2026-10-23 19:39:58.002109+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Mini Micro", "MiniScript", "Gemini protocol", "Joe Strout", "Python"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/how-i-made-a-barebones-gemini-client-for-the-mini-micro", "markdown": "https://wpnews.pro/news/how-i-made-a-barebones-gemini-client-for-the-mini-micro.md", "text": "https://wpnews.pro/news/how-i-made-a-barebones-gemini-client-for-the-mini-micro.txt", "jsonld": "https://wpnews.pro/news/how-i-made-a-barebones-gemini-client-for-the-mini-micro.jsonld"}}