A fast, extensible, Gopher-protocol server written in Crystal
An implementation of RFC 1437, the Gopher protocol.
This repository is 2 things:
The Gopher protocol consists of 2 phases: request & response.
Like its relative HTTP, clients makes a request for a URI to the server, and the server responds.
Unlike HTTP, however, there are no headers, caching, MIME response types, keepalives, etc.
This makes the protocol both simpler and less featureful.
A request to a gopher:// server consists of a single line, containing a URI (called a selector):
/1stuff/1and/1nonsense/0intro.txt\r\n
the server then resolves that request into a response, and renders it back to the client.
A Response can be one of 3 things:
A copy of the RFC that describes the protocol is included in this repo
To use this library, you need to:
Server
objectResolver
(s) that instruct it how to find contentA good example for how this can be done exists in src/example.cr
If you’re looking for a more turnkey solution, check out its sister project
Port70.
Testing on the application is built using the excellent minitest.cr.
Run tests with crystal spec
.