1 Gopher_protocol_support
Moritz Strohm edited this page 10 months ago

Gopher protocol support

MoeNavigatorEngine supports both network and basic document retrieval using the gopher protocol.

Gopher network support

The GopherRequest class is responsible for the data transfer from and to a gopher server. It has a getter and setter method for the search string, so that gopher servers can be queried using MoeNavigatorEngine.

The search string must be provided in the resource parameter of the constructor of the GopherRequest class, separated by a tab character, as specified in RFC 4266.

The URL class should soon be able to decode URL encoded characters so that it is recommended to pass a gopher URL to the URL class first to let it handle the decoding.

Gopher menu support

The GopherMenuParser class can parse gopher menus and output them in a DOM structure. The following node names are used:

  • menu: The root node of the menu.
  • link: A link in the resource.

All text is placed in text nodes directly below the menu node.

Handling gopher resources

Type 0 (plain text)

Text resources (gopher type 0) are handled by the PlaintextParser class. That class outputs a DOM with only one root node called "PlainText". All the text is placed unmodified as text node inside the PlainText node.

Type 1 (menu) and 7 (search service)

Menu and search service resources are parsed by the GopherMenuParser (see above).

Other resource

Other resources are not yet supported as of MoeNavigatorEngine version 0.0.1.