Gemini (protocol)

The Gemini protocol is an application layer protocol for distributed hypertext information systems that provides access to simple, primarily textual documents in Gemini space. This is done with contemporary technologies such as TLS, thereby improving privacy and user agency relative to the Web. Servers run by default on port 1965.
The protocol is being designed collaboratively and is not currently being standardized as an internet standard.
The design is inspired by the Gopher protocol, but mandates the use of Transport Layer Security with trust on first use (TOFU) and privacy-related features. It is not intended to replace Gopher or HTTP, but to co-exist with them.
Gemini is designed within the framework of the Internet protocol suite. Like HTTP(S), Gemini functions as a request–response protocol in the client–server computing model. A Gemini browser (like an HTTP web browser), for example, may be the "client" and an application running on a computer hosting a Gemini site may be the "server". The client submits a Gemini "request" message to the server.
Gemini resources are identified and located on the network by Uniform Resource Locators (URLs), using the URI scheme "gemini://" which is analogous to "https" for the HTTPS web. There exists no insecure analog within Gemini to the original "http" scheme. As with HTTP hypertext, URIs are encoded as hyperlinks in gem-text documents, so as to form interlinked hypertext documents in the Gemini "web", which users refer to as Gemini space.
Much like the original HTTP 0.9 specification, a Gemini request is only a URL, and the current draft specifications call for this request format to not be extensible, in order to preserve one of the project's stated goals of simplicity, and to thus differentiate the forward path for Gemini vs HTTP. In a conscious design choice analogous to the original HTTP/0.9, Gemini uses a separate connection to the same server for every resource request. This design, for simplicity and user control, does not allow for more data to be requested or supplied by the server without further explicit requests from the client. Although the cost of this may be more latency in the establishment of TCP connections, the intent of Gemini is to provide a web of simpler documents (e.g. with regard to embedded images), which should load quickly over modern networks.
Example session.
Gemini protocol transactions consist of a single request and response per TCP session. A successful response includes the MIME type of the requested object but no other metadata. After responding, the server terminates the connection. Both requests and responses use lines terminated by CRLF (carriage return + line feed).
 C: gemini://example.com/
 S: 20 text/gemini
 S: # Example Title
 S:* Example list item
 S:* Second Example list item
 S: Welcome to my Gemini capsule. [etc]
Software.
Various server implementations exist; lists thereof are maintained online.
Due to the simplicity of the protocol and served media type, various Gemini browsers were implemented. The following non-exhaustive list of clients highlights their diversity. Further lists are available online: