The Gopher internet protocol is a TCP-based, client-server system for distributed document search and retrieval. A Gopher client shows material as a file-like hierarchy of menus, documents, and searches. Behind each visible menu choice are the selector, host, and port needed to ask a server for the resource.
That arrangement lets a collection spread across autonomous servers appear as one organized information system. Internet protocols assign different jobs to different parts of the network stack; Gopher defines the document-request convention that runs over TCP.
How Gopher retrieves a document
A client opens a TCP connection to a server and sends a selector string, a line of text that identifies the requested item and may be empty. In the base protocol, the server returns either a document or a directory list, then closes the connection. The server retains no state after the request.
- Start with a menu. The client receives a directory listing and presents its names as choices, much like folders and files.
- Select an item. The person sees a human-readable name. The client reads the technical fields in that menu entry.
- Connect to the destination. The entry identifies a host and a port.
- Send the selector. The client sends the item’s selector string.
- Display the result. The server returns a document or another directory list, and the client can repeat the process for another selection.
A menu entry contains the retrieval details
Each directory-listing item carries five pieces of information: an item type, a user-visible name, a selector string, a host name, and a port number. The visible name is the label a reader chooses. The client uses the selector, host, and port to locate and retrieve the item; the type identifies the kind of object represented.
Hypothetical example: a menu might display Network notes. Its underlying entry could identify it as a text item, supply a selector such as notes/network, name gopher.example as the host, and give a port. Selecting the label makes the client connect to that host and port and send the selector. The menu is a user interface over a distributed set of destinations, not a claim that every document sits on one machine.
How searches fit the menu model
A search item sends the client to a search server. The client transmits the selector, if there is one, followed by the words to match. The response is a virtual directory listing containing matching items. Those entries carry the information the client needs for retrieval.
Reading a gopher:// address
The standardized URI form is gopher://host:port/gopher-path. It names an internet resource available through Gopher. If the port is left out, it defaults to 70.
- gopher:// identifies the URI scheme.
- host names the server to contact.
- :port is optional because port 70 is the default.
- gopher-path begins with a one-character Gopher resource type, followed by the selector.
An empty selector addresses a server’s top-level directory. A search URI adds an encoded tab, written %09, followed by the search text. When making that request, the client sends the selector, a tab, and the search string.
Base Gopher and Gopher+
Base Gopher handles items and collections of items, meaning directories. Gopher+ is an upward-compatible extension that can associate arbitrary attributes and alternative data representations with an item. It also supports electronic forms. RFC 4266 notes that Gopher+ was uncommon even while Gopher was popular.
Where Gopher sits in internet history
Mark P. McCahill and colleagues at the University of Minnesota released Gopher in 1991. RFC 1436 documented the protocol as a distributed document search-and-retrieval system. RFC 4266, published in 2005, says Gopher was widely implemented in the early 1990s and that few servers were in use when that RFC was written.
Gopher’s useful design is concrete: it separates a readable menu label from the instructions required to fetch an item, allowing a client to present a hierarchy even when information is distributed across the network.
Sources
- (PDF) The Internet Gopher Protocol: A distributed document search and ... — www.researchgate.net
- RFC 4266 - The gopher URI Scheme - IETF Datatracker — datatracker.ietf.org
- Gopher (protocol) - Wikipedia — en.wikipedia.org