RFC 4266

The gopher URI Scheme

πŸ“… published November 2005, from ietf

RFC 4266: The gopher URI Scheme 🐿️✨

Okay bestie, here's the tea πŸ«– This is RFC 4266, called "The gopher URI Scheme" πŸŽ€. Paul Hoffman from the VPN Consortium wrote it πŸ’… and it came out in November 2005 🌸. It's on the Standards Track 🌈 and it obsoletes RFC 1738 πŸ‘‘, which is the big reason it exists at all.


Status of This Memo ✨

This document is an Internet standards track protocol for the Internet community, and it's basically asking everyone to talk about it and suggest improvements πŸ’¬. For the standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1) πŸ“–. Distribution of this memo is unlimited πŸ¦‹.

Copyright (C) The Internet Society (2005) πŸ’œ.

Abstract πŸ“

Okay so this document specifies the gopher Uniform Resource Identifier (URI) scheme, which was first specified in RFC 1738 🐿️. The whole point is to let RFC 1738 be made obsolete while the gopher info stays on the standards track. Main character energy πŸ‘‘.

1. Introduction 🌸

URIs were first defined in RFC 2396 [RFC2396], and then RFC 3986 [RFC3986] updated that. Both of those documents also explain how to define schemes for URIs 🫢.

The first definition for a lot of URI schemes showed up in RFC 1738 [RFC1738]. Since that document is now obsolete, this one copies the gopher URI scheme over from it so the material can stay on standards track πŸ’–.

2. Scheme Definition 🧚

The gopher URL scheme is used to point at Internet resources you can reach with the Gopher protocol 🐿️✨.

The base Gopher protocol is described in RFC 1436 [RFC1436]. It supports items and collections of items (directories) πŸ“. Gopher+ is a set of upward-compatible extensions to the base Gopher protocol and is described in [Gopher+] πŸŽ€. It lets you attach arbitrary sets of attributes and alternate data representations to Gopher items, and Gopher URLs cover both Gopher and Gopher+ items and their attributes πŸ’….

Historical note: The Gopher protocol was everywhere in the early 1990s, but hardly any Gopher servers are still running today πŸ₯².

2.1. Gopher URL Syntax πŸ¦‹

A Gopher URL takes this form:

gopher://<host>:<port>/<gopher-path>

where <gopher-path> is one of:

<gophertype><selector>
<gophertype><selector>%09<search>
<gophertype><selector>%09<search>%09<gopher+_string>

If :<port> is left out, the port defaults to 70 πŸ”₯. <gophertype> is a single-character field that says what Gopher type the URL's resource is 🧩. The whole <gopher-path> can also be empty. In that case the delimiting "/" is optional too, and <gophertype> defaults to "1" ✨.

<selector> is the Gopher selector string. In the Gopher protocol it's a sequence of octets that can hold any octets except 09 hexadecimal (US-ASCII HT or tab), 0A hexadecimal (US-ASCII character LF), and 0D (US-ASCII character CR) πŸ™ˆ.

Gopher clients pick which item they want by sending the Gopher selector string to a Gopher server πŸ“¬.

Inside the <gopher-path>, no characters are reserved 🌈.

Heads up, some Gopher <selector> strings start with a copy of the <gophertype> character. When that happens, the character shows up twice in a row πŸ‘―. The Gopher selector string can also be an empty string, and that's how Gopher clients refer to the top-level directory on a Gopher server 🏠.

2.2. Specifying URLs for Gopher Search Engines πŸ”

If the URL is pointing at a search that gets submitted to a Gopher search engine, the selector is followed by an encoded tab (%09) and then the search string 🫧. To submit that search, the Gopher client sends the <selector> string (after decoding it), a tab, and the search string to the Gopher server πŸ’Œ.

2.3. URL Syntax for Gopher+ Items πŸ’œ

Historical note: Gopher+ was uncommon even back when regular Gopher was popular 😭.

URLs for Gopher+ items get a second encoded tab (%09) and a Gopher+ string. In this case the %09<search> part must be included, even though the <search> element is allowed to be the empty string πŸ™ƒ.

The <gopher+_string> carries the info needed to retrieve the Gopher+ item. Gopher+ items can have alternate views and arbitrary sets of attributes, and they can also have electronic forms attached 🧾.

To grab the data behind a Gopher+ URL, a client connects to the server and sends the Gopher selector, then a tab and the search string (which can be empty), then another tab and the Gopher+ commands 🎬.

2.4. Default Gopher+ Data Representation 🎨

When a Gopher server sends a directory listing to a client, its Gopher+ items get tagged with either a "+" (meaning Gopher+ items) or a "?" (meaning Gopher+ items that have a +ASK form attached) 🏷️. A Gopher URL whose Gopher+ string is only a "+" points at the default view (data representation) of the item. A Gopher+ string that's only a "?" points at an item with a Gopher electronic form attached πŸ’….

2.5. Gopher+ Items with Electronic Forms πŸ“

Gopher+ items with a +ASK attached (the ones tagged with "?") need the client to fetch the item's +ASK attribute to get the form definition πŸ“‹. Then the client asks the user to fill out the form, and sends the user's answers back along with the selector string to get the item πŸ™Œ. Gopher+ clients already know how to do all this, but they rely on the "?" tag in the item description to know when to handle it 🧠. The "?" shows up in the Gopher+ string because it matches how the Gopher+ protocol uses that symbol πŸ”.

2.6. Gopher+ Item Attribute Collections πŸ—‚οΈ

To refer to a Gopher+ item's attributes, the Gopher URL's Gopher+ string is "!" or "$". "!" means all of one item's Gopher+ attributes 🎯. "$" means all the item attributes for every item in a Gopher directory 🌟.

2.7. Referring to Specific Gopher+ Attributes πŸ”–

To point at specific attributes, the URL's gopher+_string is "!<attribute_name>" or "$<attribute_name>" πŸŽ€. For example, to get the attribute holding an item's abstract, the gopher+_string would be "!+ABSTRACT" πŸ“„.

To refer to several attributes at once, the gopher+_string is the attribute names separated by coded spaces. For example, "!+ABSTRACT% 20+SMELL" refers to the +ABSTRACT and +SMELL attributes of an item πŸ‘ƒβœ¨.

2.8. URL Syntax for Gopher+ Alternate Views 🌍

Gopher+ lets items have optional alternate data representations (alternate views) πŸ–ΌοΈ. To get one, a Gopher+ client sends the right view and language identifier, which you can find in the item's +VIEW attribute πŸ”‘. To point at a specific alternate view, the URL's Gopher+ string looks like this:

+<view_name>%20<language_name>

For example, a Gopher+ string of "+application/postscript%20Es_ES" refers to the Spanish-language postscript alternate view of a Gopher+ item πŸ‡ͺπŸ‡ΈπŸ’•.

2.9. URL Syntax for Gopher+ Electronic Forms πŸ“‘

The gopher+_string for a URL pointing at an item referenced by a Gopher+ electronic form (an ASK block) that's been filled out with specific values is a coded version of what the client sends to the server 🫧. The gopher+_string looks like this:

+%091%0D%0A+-1%0D%0A<ask_item1_value>%0D%0A
<ask_item2_value>%0D%0A.%0D%0A

To retrieve this item, the Gopher client sends the following text to the Gopher server:

<a_gopher_selector><tab>+<tab>1<cr><lf>
+-1<cr><lf>
<ask_item1_value><cr><lf>
<ask_item2_value><cr><lf>
.<cr><lf>

3. Security Considerations πŸ”

Okay, security is serious, so listen up 🚨. There are lots of security considerations for URI schemes, and they're discussed in [RFC3986] πŸ“š. The Gopher protocol uses passwords in the clear for authentication and offers no privacy, and both of those are considered extremely unsafe in current practice πŸ’€πŸ˜­.

4. Informative References πŸ“š

[Gopher+] Anklesaria, F., et al., "Gopher+: Upward compatible enhancements to the Internet Gopher protocol", University of Minnesota, July 1993, <ftp://boombox.micro.umn.edu/pub/gopher/gopher_protocol/Gopher+/Gopher+.txt> 🐿️

[RFC1738] Berners-Lee, T., Masinter, L., and M. McCahill, "Uniform Resource Locators (URL)", RFC 1738, December 1994. 🌸

[RFC2396] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax", RFC 2396, August 1998. 🌷

[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005. πŸ’–

[RFC1436] Anklesaria, F., McCahill, M., Lindner, P., Johnson, D., Torrey, D., and B. Albert, "The Internet Gopher Protocol (a distributed document search and retrieval protocol)", RFC 1436, March 1993. 🧚

Author's Address πŸŽ€

Paul Hoffman
VPN Consortium
127 Segre Place
Santa Cruz, CA  95060
US

EMail: paul.hoffman@vpnc.org

Copyright (C) The Internet Society (2005).

This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Intellectual Property πŸ¦‹

The IETF takes no position on the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document, or on whether any license under those rights might or might not be available. It also doesn't claim to have made any independent effort to identify such rights 🫢. Info on the procedures for rights in RFC documents can be found in BCP 78 and BCP 79 πŸ“œ.

Copies of IPR disclosures made to the IETF Secretariat, any assurances of licenses to be made available, or the result of an attempt to get a general license or permission for implementers or users to use such proprietary rights can be found in the IETF on-line IPR repository at http://www.ietf.org/ipr πŸ”.

The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology needed to implement this standard. Send that info to the IETF at ietf-ipr@ietf.org πŸ“¨.

Acknowledgement 🌈

Funding for the RFC Editor function is currently provided by the Internet Society πŸ’–.

πŸ“¦ where this page comes from