[tech] /.well-known/capability ehlo
Petite Abeille
petite.abeille at gmail.com
Sun Dec 20 00:39:42 GMT 2020
Older protocols such as SMTP, POP3, IMAP, and NNTP have developed extension mechanism overtime:
SMTP has EHLO.
POP3 has CAPA.
IMAP has CAPABILITY.
NNTP has CAPABILITIES.
The principle is always the same: the client invoke a well known server command to list the server capabilities. The client can then use these extensions in coordination with the server.
The server capabilities are represented as a set of keywords, such as 8BITMIME, CHUNKING, PIPELINING, SIZE, etc, etc...
For example, in SMTP:
C: EHLO
S: 250-8BITMIME
This tell the client the server supports 8 bit data transmission, enabling the client to send such data, in addition to the 7bit defined by the standard.
In Gemini, a consenting client-server pair would use a similar mechanism to discover and negotiate new capabilities; above and beyond the ones defined by the standard itself.
Upon receiving a request at /.well-known/capability, a compatible server would respond with a text listing its capabilities, as keywords, one per line:
C: gemini://mozz.us/.well-known/capability
S: text
IRI
For example, the IRI keyword tells the client the server can understand and generate IRIs for both request and text/gemini links; in addition to the regular URIs defined by the specification itself.
Another capability could be EHLO.
EHLO tells the client it can extend the initial Gemini request with further keywords, after the URI:
C: gemini://mozz.us/bunny.gmi IRI
S: text/gemini
=> gemini://🐇.hole/🐰%20%26%20🥕.gmi 🐰 & 🥕: Down The Rabbit Hole, a journey.
Another server extension could be CHUNK, telling the client to expect chunked transfer encoding.
Another server extension could be SIZE, telling the client to expect an additional size parameter, as part of the content type.
Another server extension could be PERSIST, informing the client the connection can be maintained after a response, allowing the client to issue further requests over the same connection.
Putting this together:
C: gemini://mozz.us/.well-known/capability
S: text
EHLO
IRI
PERSISTENT
SIZE
<server drops connection>
C: gemini://mozz.us/👯♀️.gmi IRI PERSIST SIZE
S: text/gemini; size=90
=> gemini://🐇.hole/🐰%20%26%20🥕.gmi 🐰 & 🥕: Down The Rabbit Hole, a journey.
<server maintains connection, awaiting a further request>
In other words -after checking the server capabilities- the client request a persistent connection, with content size, and IRIs.
That's all folks.
Thoughts? Opinions? Likes? Dislikes? Something?
More information about the Gemini
mailing list