2019-06-18 A Simple Text Server

Solderpunk was writing about Gopher and the Web again. [1] [2] [3] And Ratfactor. [4] [5] [6] [7] [8] [9]

Personally, I’m not too convinced. I am, however, somewhat interested in a simple text server that just serves text files.

If we then agree that the text files may contain hyperlinks, such as Markdown files, or plain text files with URLs in them, then we can write clients that retrieve these text files and allow us to request more.

So that’s what I did. I wrote a little server that serves text files. Requests are simple selectors. Like Gopher. Like Finger. Remember, finger is gopher!

I called it Nimi Mute, “many words.”

As you can see in the README, you can even use finger or lynx to get text files from it! It’s all the same. telnet and nc also work, of course. 🙂

This is basically Gopher without the menus.

And since I really care about the read/write aspect of it all, I also included a way to upload files if you know the password.

And since I also care about encryption, I also showed how to encrypt it all and how to test it using gnutls-cli.

Tags:

Comments

Here I am using lynx as the client:

                                                                           (p1 of 7)
Nimi Mute
=========

This is a simple file server. It's a return to the old days of the
Internet: send a "selector" and get back some text. That's it.

It's simpler than gopher because we don't care about menus.

It's simpler than the web because we don't have request headers.

It's simpler than finger because we don't have structured information.

Examples:

```
# startup server (serving the current directory, and more log messages)
perl nimi-mute.pl --port 7079 --log_level=4
# print the default page (README.md)
echo | nc localhost 7079
# if you have mdcat installed, highlight your Markdown
echo README.md | nc localhost 7079 | mdcat
# if you have lynx installed, use fake gopher
lynx gopher://localhost:7079
# when requesting files, make sure to add a leading zero!
lynx gopher://localhost:7079/0README.md
-- press space for next page --
  Arrow keys: Up and Down to move.  Right to follow a link; Left to go back.
 H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list 

– Alex Schroeder 2019-06-18 09:55 UTC


Actually, since the text server is compatible with Gopher, and since VF-1 extracts links from text files, we can already use VF-1 as a client!

Here’s me browsing a directory containing both A.txt and B.txt linking to each other.

alex@melanobombus:~/src/nimi-mute$ vf1 gopher://localhost:7079/0A.txt
Using config /home/alex/.config/.vf1rc
Welcome to VF-1!
Enjoy your flight through Gopherspace...
This is a simple file that links to B.

gopher://localhost:7079/0B.txt
VF-1> links
[1] gopher://localhost:7079/0B.txt
VF-1> 1
This is a simple file that links to A.

gopher://localhost:7079/0A.txt
VF-1> 















– Alex Schroeder 2019-06-18 10:14 UTC


Now, there currently is no way to upload a binary file. That would require a little bit of extra work because we need to indicate the number of bytes we intend to send. At the same time, however, if you already have a binary file up there, say screenshot.jpg, and link to it using a gopher link for binary files, e.g. gopher://localhost:7079/9screenshot.jpg, then it will simply work. Your gopher client can download the file, no problem. And you can download it directly, too:

$ echo screenshot.jpg | nc localhost 7079 > test.jpg
$ diff -s screenshot.jpg test.jpg 
Files screenshot.jpg and test.jpg are identical

👍

– Alex Schroeder 2019-06-18 10:36 UTC


@solderpunk said on Mastodon:

This could basically be a nice ultralight protocol all on its own!

  1. All connections are TLS secured
  2. Requests are a UTF-8 encoded selector and a CLRF, nothing more
  3. Responses are guaranteed UTF-8 encoded text
  4. No further structure of response is guaranteed
  5. Clients should be able to extract any URLs from anywhere in the text and construct a menu, with interface of their own choosing.

And I’d add “Uploads using SOH, STX, and ETX.” 😅

– Alex Schroeder 2019-06-18 20:13 UTC


I wrote a little web client: Soweli Lukin available from the same repo. See 2019-06-19 A Simple Text Client for more. I’ll say, however, that system load shot to over 30 when I tried it (including posting a link to Mastodon), so surely some things still need work!

Load

I had to disable it again! 😨

– Alex Schroeder 2019-06-19 15:00 UTC


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.