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!
===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).
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)