lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lynx-dev] Gemini Support?


From: Bela Lubkin
Subject: Re: [Lynx-dev] Gemini Support?
Date: Tue, 29 Sep 2020 03:52:12 -0700

Visiblink wrote:

> I browse a number of gopher sites, but a lot of the people who were once
> there are now using the gemini protocol (see
> https://gemini.circumlunar.space/ for information).
>
> Is there any possibility that gemini support might be added to lynx in
> the future? One of the best features of lynx is that it allows users to
> access gopher and the web in the same client. It would be great to add
> gemini as well.

FWIW, I looked at the various Gemini browser implementations offered.
The one that seemed internally simplest, most likely to be amenable to
bludgeoning into a set of C code to implement the protocol, was the Rust
implementation 'Asuka' (git.sr.ht/~julienxx/asuka).  (Checking out the
very oldest commit in its git history provides a 14-line simple raw
gemini-protocol content grabber...)

Furthermore, it looks like the protocol can be summarized as:

1. parse 'gemini://host.dom/path/to/thing.ext' as:
   - save 'host.dom' as 'host'
   - save entire URL as 'url'
   - invoke 'gemini' procotol handler
2. open TLS(1.2 or higher,pref 1.3+) connection to '$host:1965'
   (providing client certificate if available)
3. send '$url\r\n'  (e.g. 'gemini://host.dom/path/to/thing.ext\r\n')
4. read content
5. close connection
6. first line of $content is status (see spec)
7. for success status, rest of $content is text or binary, per MIME type
   given in $status
8. MIME type 'text/gemini' specs a trivial text formatting language

Full spec is at https://gemini.circumlunar.space/docs/specification.html

Aside from wire protocol handling, Lynx would need to know how to manage
a client certificate, and be able to display text/gemini.  That could be
done with standard mime.types & mailcap, with an external text/gemini
decoding program, if one exists.  But text/gemini is trivial and can
probably be implemented with a few lines of regexp substitutions to
mangle text/gemini to (very simple) text/html.  Possibly the trickiest
bit would be preventing apparent HTML tags & entities in the text/gemini
source from being parsed as HTML tags & entities...

>Bela<



reply via email to

[Prev in Thread] Current Thread [Next in Thread]