Date: 2025-01-30
Last Update: 2025-02-01

NEX protocol
------------

NEX is internet protocol to get data.

Server should listen on port 1900. User connects and sends the server
a path which may be empty. The server responds with text or binary
data and close the connection. No state is retained.

Document content is returned as-is. Directory content use plain text
with a special syntax where each line beginning with '=> ' followed
by a URL is considred a link. The URL can be absolute or relative.
Here are examples:

 => nex://morena.rip
 => about
 => /board/
 => http://morena.rip
 => gopher://morena.rip/0log

Client can assume that an empty path or a path finishing with / is
a directory. A document should be displayed based on the path's file
extension. When there is no extension, plain text is assumed.

Here is an example of telnet session:
telnet morena.rip 1900
about

Simple line with netcat:
echo board | nc morena.rip 1900

----------------------------------------------------------------------

The ability to simplify means to eliminate the unnecessary, so that
the necessary may speak.