Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Gopher (protocol)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Technical details== The conceptualization of knowledge in "Gopher space" or a "cloud" as specific information in a particular file, and the prominence of the FTP, influenced the technology and the resulting functionality of Gopher. === Gopher characteristics === Gopher is designed to function and to appear much like a mountable read-only global [[Distributed file system|network file system]] (and software, such as [gopher://gopher.r-36.net/1/scm/gopherfs gopherfs], is available that can actually mount a Gopher server as a [[Filesystem in Userspace|FUSE]] resource). At a minimum, whatever can be done with data files on a [[CD-ROM]], can be done on Gopher. A Gopher system consists of a series of hierarchical hyperlinkable menus. The choice of menu items and titles is controlled by the administrator of the server. Similar to a file on a Web server, a file on a Gopher server can be linked to as a menu item from any other Gopher server. Many servers take advantage of this inter-server linking to provide a directory of other servers that the user can access. ===Protocol=== The Gopher protocol was first described in {{IETF RFC|1436}}. [[Internet Assigned Numbers Authority]] (IANA) has assigned [[Transmission Control Protocol]] (TCP) [[List of well-known ports (computing)|port]] 70 to the Gopher protocol. The protocol is simple to negotiate, making it possible to browse without using a client. ====User request==== First, the client establishes a TCP connection with the server on port 70, the standard gopher port. The client then sends a string followed by a carriage return followed by a [[Newline|line feed]] (a "CR + LF" sequence). This is the selector, which identifies the document to be retrieved. If the item selector were an empty line, the default directory would be selected. ====Server response==== The server then replies with the requested item and closes the connection. According to the protocol, before the connection closes, the server should send a full-stop (i.e., a period character) on a line by itself. However, not all servers conform to this part of the protocol and the server may close a connection without returning a final full-stop. The main type of reply from the server is a text or binary resource. Alternatively, the resource can be a menu: a form of structured text resource providing references to other resources. Because of the simplicity of the Gopher protocol, tools such as [[netcat]] make it possible to download Gopher content easily from a command line: <syntaxhighlight lang="console"> $ echo jacks/jack.exe | nc gopher.example.org 70 > jack.exe </syntaxhighlight> The protocol is also supported by [[cURL]] since 7.21.2-DEV, which was released in 2010.<ref>{{cite mailing list|title=Curl: Re: Gopher patches for cURL (includes test suite)|url=https://curl.haxx.se/mail/lib-2010-08/0346.html |date=25 Aug 2010|access-date=9 March 2020 |mailing-list=curl-library|url-status=live|archive-url=https://web.archive.org/web/20190421225505/https://curl.haxx.se/mail/lib-2010-08/0346.html|archive-date=21 April 2019}}</ref> ====Search request==== The selector string in the request can optionally be followed by a tab character and a search string. This is used by item type 7. ===Source code of a menu=== Gopher menu items are defined by lines of [[tab-separated values]] in a [[text file]]. This file is sometimes called a ''gophermap''. As the [[source code]] to a gopher menu, a gophermap is roughly analogous to an [[HTML]] file for a [[web page]]. Each tab-separated line (called a ''selector line'') gives the [[client software]] a description of the menu item: what it is, what it is called, and where it leads to. The client displays the menu items in the order that they appear in the gophermap. The first character in a selector line indicates the ''item type'', which tells the client what kind of file or protocol the menu item points to. This helps the client decide what to do with it. Gopher's item types are a more basic precursor to the [[media type]] system used by the Web and [[email attachment]]s. The item type is followed by the ''user display string'' (a description or label that represents the item in the menu); the selector (a [[Path (computing)|path]] or other string for the resource on the server); the ''hostname'' (the [[domain name]] or [[IP address]] of the server), and the [[network port]]. All lines in a gopher menu are terminated by "CR + LF". Example of a selector line in a menu source: The following selector line generates a link to the "/home" [[Directory (computing)|directory]] at the [[subdomain]] gopher.floodgap.com, on [[Port (computer networking)|port]] 70. The item type of {{var|1}} indicates that the linked resource is a Gopher menu itself. The string "Floodgap Home" is what the client will show to the user when visiting the example menu. 1Floodgap Home /home gopher.floodgap.com 70 {| class="wikitable" style="text-align:center" ! Item type !! User display string !! Selector !! Hostname !! [[Port (computer networking)|Port]] |- | 1 || Floodgap Home || /home || gopher.floodgap.com || 70 |} ====Item types==== In a Gopher menu's source code, a one-character code indicates what kind of content the client should expect. This code may either be a digit or a letter of the alphabet; letters are [[case-sensitive]]. The [[technical specification]] for Gopher, {{IETF RFC|1436}}, defines 14 item types. The later gopher+ specification defined an additional 3 types.<ref>{{cite web |title=Gopher+ protocol specification |url=https://github.com/jgoerzen/pygopherd/blob/master/doc/standards/Gopher%2B.txt |publisher=[[GitHub]]}}</ref> A one-character code indicates what kind of content the client should expect. Item type {{code|3}} is an [[error code]] for [[exception handling]]. Gopher client authors improvised item types {{code|h}} (HTML), {{code|i}} (informational message), and {{code|s}} ([[sound file]]) after the publication of RFC 1436. Browsers like Netscape Navigator and early versions of Microsoft Internet Explorer would prepend the item type code to the selector as described in {{IETF RFC|4266}}, so that the type of the gopher item could be determined by the url itself. Most gopher browsers still available, use these prefixes in their urls. {| class="wikitable" ! colspan="2" {{partial|Canonical types}} |- | {{okay|'''0'''}} || [[Text file]] |- | {{okay|'''1'''}} || Gopher submenu |- | {{okay|'''2'''}} || [[CCSO Nameserver]] |- | {{okay|'''3'''}} || Error code returned by a Gopher server to indicate failure |- | {{okay|'''4'''}} || [[BinHex]]-encoded file (primarily for [[Macintosh]] computers) |- | {{okay|'''5'''}} || [[DOS]] file |- | {{okay|'''6'''}} || [[uuencoded]] file |- | {{okay|'''7'''}} || Gopher [[full-text search]] |- | {{okay|'''8'''}} || [[Telnet]] |- | {{okay|'''9'''}} || [[Binary file]] |- | {{okay|'''+'''}} || Mirror or alternate server (for [[Load balancing (computing)|load balancing]] or in case of primary server [[downtime]]) |- | {{okay|'''g'''}} || [[GIF]] file |- | {{okay|'''I'''}} || [[Image file]] |- | {{okay|'''T'''}} || [[Telnet 3270]] |- ! colspan="2" {{partial|gopher+ types}} |- | {{okay|''':'''}} || [[Bitmap|Bitmap image]] |- | {{okay|''';'''}} || [[Video file format|Movie file]] |- | {{okay|'''<'''}} || [[Audio file format|Sound file]] |- ! colspan="2" {{unofficial|Non-canonical types}} |- |style="background:#adffe6; text-align:center" | '''d''' || Doc. Seen used alongside PDF and .doc files |- | style="background:#adffe6; text-align:center" | '''h''' || [[HTML]] file |- | style="background:#adffe6; text-align:center" | '''i''' || Informational message, widely used.<ref>{{cite web|url=https://sunriseprogrammer.blogspot.com/2019/03/directory-entry-says-what-current.html|title=Directory entry says what? Current Gopher type field types|date=5 March 2019}}</ref> |- | style="background:#adffe6; text-align:center" | '''p''' || image file "(especially the [[Portable Network Graphics|PNG]] format)" |- | style="background:#adffe6; text-align:center" | '''r''' || document RTF file ("[[Rich Text Format]]") |- | style="background:#adffe6; text-align:center" | '''s''' || [[Sound file]] (especially the [[WAV]] format) |- | style="background:#adffe6; text-align:center" | '''P''' || [[PDF]] (Portable Document Format) file |- | style="background:#adffe6; text-align:center" | '''X''' || [[XML]] (Extensible Markup Language) file |} Here is an example gopher session where the user requires a gopher menu ({{code|/Reference}} on the first line): <pre> /Reference 1CIA World Factbook /Archives/mirrors/textfiles.com/politics/CIA gopher.quux.org 70 0Jargon 4.2.0 /Reference/Jargon 4.2.0 gopher.quux.org 70 + 1Online Libraries /Reference/Online Libraries gopher.quux.org 70 + 1RFCs: Internet Standards /Computers/Standards and Specs/RFC gopher.quux.org 70 1U.S. Gazetteer /Reference/U.S. Gazetteer gopher.quux.org 70 + iThis file contains information on United States fake (NULL) 0 icities, counties, and geographical areas. It has fake (NULL) 0 ilatitude/longitude, population, land and water area, fake (NULL) 0 iand ZIP codes. fake (NULL) 0 i fake (NULL) 0 iTo search for a city, enter the city's name. To search fake (NULL) 0 ifor a county, use the name plus County -- for instance, fake (NULL) 0 iDallas County. fake (NULL) 0 </pre> The gopher menu sent back from the server, is a sequence of lines each of which describes an item that can be retrieved. Most clients will display these as [[hypertext]] links, and so allow the user to navigate through gopherspace by following the links.<ref name="wwwunleashed"/> This menu includes a text resource (itemtype {{code|0}} on the third line), multiple links to submenus (itemtype {{code|1}}, on the second line as well as lines 4–6) and a non-standard information message (from line 7 on), broken down to multiple lines by providing dummy values for selector, host and port. ====External links==== Historically, to create a link to a Web server, "GET /" was used as a pseudo-selector to emulate an [[HTTP]] [[GET request]].<ref>{{cite web|url=https://math.albany.edu/g/Adm/goph-www.html#1.2 |title=Gopher in the World-Wide Web |access-date=2021-09-29}}</ref> John Goerzen created an addition<ref>{{cite mailing list|url=http://gopher.quux.org/Archives/Mailing%20Lists/gopher/gopher.2002-02 |mailing-list=gopher|title=Gopher: gopher.2002-02 |publisher=Gopher.quux.org |access-date=2015-08-12}}</ref> to the Gopher protocol, commonly referred to as "[[Uniform Resource Locator|URL]] links", that allows links to any protocol that supports URLs. For example, to create a link to http://gopher.quux.org/, the item type is {{code|h}}, the display string is the title of the link, the item selector is "<nowiki>URL:http://gopher.quux.org/</nowiki>", and the domain and port are that of the originating Gopher server (so that clients that do not support URL links will query the server and receive an HTML redirection page). ===Gopher+=== Gopher+ is a forward compatible enhancement to the Gopher protocol. Gopher+ works by sending [[metadata]] between the client and the server. The enhancement was never widely adopted by Gopher servers.<ref>{{cite newsgroup |last1=Mešnjak |first1=Matjaž |date=16 February 2009 |title=Re: New Gopher server and client |url=http://permalink.gmane.org/gmane.network.gopher.general/2571 |newsgroup=gmane.network.gopher.general |archive-url=https://web.archive.org/web/20150310110257/http://permalink.gmane.org/gmane.network.gopher.general/2571 |archive-date=10 March 2015 |access-date=3 February 2012}}</ref><ref>{{cite newsgroup|title=Re: Server Contact Information|url=http://permalink.gmane.org/gmane.network.gopher.general/1814 |date=14 January 2008 |newsgroup=gmane.network.gopher.general |author1=JumpJet Mailbox |archive-url=https://web.archive.org/web/20150310110252/http://permalink.gmane.org/gmane.network.gopher.general/1814|archive-date=10 March 2015|access-date=3 February 2012}}</ref>{{Ref RFC|4266}} The client sends a tab followed by a +. A Gopher+ server will respond with a status line followed by the content the client requested. An item is marked as supporting Gopher+ in the Gopher directory listing by a tab + after the port (this is the case of some of the items in the example above). Other features of Gopher+ include: * Item attributes, which can include the items ** Administrator ** Last date of modification ** Different views of the file, like [[PostScript]] or plain text, or different languages ** Abstract, or description of the item * Interactive queries
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)