Gopher2000 - A Modern Gopher Server

I'm old enough that the Internet basically didn't exist for anyone other than a college student or scientist when I was a teenager, but by the time I graduated from college it was everywhere. My first access to the Internet was via a friend-of-a-friend-of-a-friend's borrowed account on a Clark University server while I was in high school. I still remember the password.

I was nerdy enough to be dialing into BBSes at this point, and I even managed to communicate over some distance in discussion groups via FIDOnet, but that was a pretty pale comparison to undiscovered wilderness of the Internet. Most of my knowledge of the Internet came from reading The Cuckoo's Egg. When I finally had real access, naturally I spent most of my time playing on Multi-User Dungeons like DartMud and EOTL – and somehow they both still exist. At the time, everything was text-based, so welcome screens like these were pretty amazing.

My friends and I would learn about interesting FTP servers, and we tried to download interesting documents and applications from them, but we barely knew any commands to use, and the files were always in weird archive formats that we didn't understand at the time, and of course you couldn't Google it.

So while it was amazing to be online, in a lot of ways it was very limiting. Until I learned about Gopher.

If you aren't familiar with it, Gopher is a very simple protocol for browsing text documents on the Internet. It doesn't sound like much, but before HTTP and the World-Wide Web, it was a revelation. There was data out there, and you could get it, if only you knew the hostname. Luckily the first few years of Wired would post interesting gopher address you could visit. Here's their description of gopher from the 'Net Surf' column of one of their early issues:

Is There a Rodent In Your Future?

If you surf the Internet and haven't heard of gopher, you're probably reefed in the backwaters somewhere. Gopher is one of cyberspace's hidden gems - the application even employs that buzz-term of computing, "client- server architecture."

Specifically, gopher is an information gathering tool that offers a smooth, menu-driven way to traverse international "gopherspace" - which these days literally means several hundred servers worldwide, offering text (from the CIA Fact Book to the Bible), computer programs, audio, still images, and even movie clips. Gopher provides a seamless, "hidden programming" interface with which you can transfer files, browse databases, and telnet to sites around the globe, simply and easily. For example, gopher the University of Wisconsin-Parkside (gopher.uwp.edu) and you'll find the music server: a collection of song lyrics, discographies and sound files from a variety of selected tunes.

Another destination, the ArchiGopher at the University of Michigan, contains photographed examples of French architecture and Ann Arbor campus buildings, as well as scanned copies of paintings by Kandinsky. Via gopher, academics can search for employment while students can seek information on various campuses. But there is a catch: To access these goodies, you must have direct access to the Internet (with client software), or be able to remotely login to Net servers that offer that capability. (The software is publicly available via ftp at boombox.micro.umn.edu, in directory pub/gopher.) Then it's as simple as typing "gopher" and the server address (with proper command accompaniment, such as "%" for Unix clients).

Gopher, the helpful rodent, was initially born of programmers at the University of Minnesota (the Gopher State) in an effort to link and search disparate, specialized computer systems on campus. Later offered up to the Net, most public gopher servers have sprung up only within the last year, while new rodents appear to be tunneling fresh soil almost daily. This little tool is a definite nugget in the ore of the Internet, rich with information. - Tom Zillner

We're Listing, Captain Every two weeks, surfers anxiously await the "Yanoff List." Compiled by Scott Yanoff, a computer science student at the University of Wisconsin (yanoff@csd4.csd.uwm.edu) the list offers concise descriptions of helpful sites around the Net. Started in 1991 as a personal log with only six entries, public distribution of The List brought a flood of suggestions: Topics now range from philosophy to amateur radio, astronomy to games. Yanoff also documents locations for such research essentials as Archie, WAIS, Netfind and World Wide Web (WWW or W3). (Internet Hunt participants remember this one ) Cut over to USENET group alt.internet.services, or ftp or gopher csd4.csd.uwm.edu (available in /pub/inet.services.txt). Don't leave cyberspace without it.

I'll Gopher That Known also as the Whole Earth 'Lectronic Link, this particular gopher shreds an info-tube It offers access to a host of electronic magazines, an SF arena featuring input from well-known cybernauts such as Bruce Sterling, as well as all the stuff you'd expect from old (and young) hippies. You'll find text from some of the major, progressive magazines, help files for traversing the big-bad-networks, the online Factsheet Five, art world calls for action, and lots more edgy stuff to gnaw on. All in an easily navigable, menu-driven environment that won't flatten out on you. This service is provided by the Well, and can be accessed at gopher.well.sf.ca.us. E-mail (gopher@well.sf.ca.us) with any questions.

Wow, has the tone of that magazine changed over 20 years.

Beyond sharing hostnames with your friends, if you knew about the Gopher search engine Veronica, then you could find all sorts of stuff. I first learned about Veronica from the teacher who ran our high school Model United Nations club. He showed us how to use it to download copies of UN Resolutions and other documents that would've been very hard to get otherwise. They still list a couple gopher servers on their website, but unfortunately I can't find one that's active anymore.

Of course, Gopher lost out to HTTP. There were some regrettable licensing decisions that scared away a lot of interest, and HTTP was always open. And even though in some ways it has never fulfilled this promise, HTTP was all about collaborative sharing and even editing of documents, something that was lacking from Gopher.

Today there's still a couple hundred gopher servers out there, with maybe a million or two pages on them, which is obviously nothing compared to the incredible mass of data you can access via your browser. But I still have a fondness for Gopher, for a few reasons. First, because it was part of my formative years on the internet. Second, because it has an important place in the history of the internet, and given how ephemeral digital history is, it's easy to lose track of this. And finally, because it is super-hackable.

And since it's so hackable, I went ahead and wrote a modern, fully-functional Gopher server in Ruby: Gopher2000

     _____             _                 _____  _____  _____  _____
    |  __ \           | |               / __  \|  _  ||  _  ||  _  |
    | |  \/ ___  _ __ | |__   ___ _ __  `' / /'| |/' || |/' || |/' |
    | | __ / _ \| '_ \| '_ \ / _ \ '__|   / /  |  /| ||  /| ||  /| |
    | |_\ \ (_) | |_) | | | |  __/ |    ./ /___\ |_/ /\ |_/ /\ |_/ /
     \____/\___/| .__/|_| |_|\___|_|    \_____/ \___/  \___/  \___/
                | |
                |_|

There are a few gopher server frameworks out there, but most of them are lacking in one way or another. They're focused on delivering static pages, or they force you to use weird methods of putting together your menus. There's even a few rough Ruby scripts out there for serving gopher requests, but they are all either so old that they don't work with a modern Ruby, or the code is lacking in one way or another.

I wanted to build the best Gopher server imaginable, using everything I've learned in my career writing software. I wanted something simple, with an easy, flexible syntax that stays out of your way. For example, this is the code for a working gopher application:

Gopher2000 is inspired by Sinatra, an awesome web framework also built in Ruby. Reviewing the code for Sinatra (and reading the book Sinatra: Up and Running) has inspired me and educated me about code more than any other place in recent memory.

Here's a few nice things about Gopher2000:

  • Simple, Sintra-inspired routing and templating DSL. It's easy to define routes, build menus, accept input, etc.
  • Dynamic routing of requests via named parameters on request paths, and dynamic responses – so you can have a dynamic, interactive gopher site.
  • It's easy to mount directories and serve up files if you're into that.
  • Integrated logging and stats.
  • Lots of helper methods for formatting output as prettily as possible

I wrote most of Gopher2000 well over a year ago, and it's been functional for a long while, but I never publicized it until now.

Anyway, the real reason I wrote Gopher2000 is to help with the top-secret gopher project which I will announce in a couple days. Frankly, it's going to blow the fucking roof off of gopherspace. The only problem is that no one will be able to see it – Gopher support has been stripped from all major web browsers over the years, and I'm guessing that you don't have a gopher client handy. My next post will talk about how I handled that problem.

Filed under: gopher, projects