Skip to content

Commit

Permalink
Update and rename README.txt to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 7, 2021
1 parent 8f898d5 commit adf5149
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions README.txt → README.md
@@ -1,3 +1,5 @@
# IcculusGopher

This is a simple Gopher server.

Read more about Gopher here: https://en.wikipedia.org/wiki/Gopher_(protocol)
Expand All @@ -6,14 +8,13 @@ To use it:

- Edit the variables at the top of the script if you want, but the defaults
are probably fine.

- By default, it looks for programs to run in "/gopherspace" ... make sure
the scripts from this source tree's gopherspace directory are there, or
wherever you edited the script to look.

- Run the script as root:

sudo ./IcculusGopher_daemon.pl -d
```bash
sudo ./IcculusGopher_daemon.pl -d
```

You have to run as root since it wants to bind TCP port 70. After startup,
the script will drop privileges. You can also run as a non-root user without
Expand All @@ -27,11 +28,11 @@ program with a fork/exec call. If a blank request comes in, a program named

These environment variables set for the handler program:

- GOPHERSPACE: where the programs are run from ("/gopherspace" by default).
- GOPHERHOST: The current server's hostname, for use in replies that are
intended to direct the client to the same server.
- GOPHERPORT: The port the Gopher server is listening on, for use in replies
that are intended to direct the client to the same server.
- `GOPHERSPACE`: where the programs are run from ("/gopherspace" by default).
- `GOPHERHOST`: The current server's hostname, for use in replies that are
intended to direct the client to the same server.
- `GOPHERPORT`: The port the Gopher server is listening on, for use in replies
that are intended to direct the client to the same server.

The handler program runs as the (non-root) user that is specified at the top
of IcculusGopher_daemon.pl.
Expand All @@ -40,10 +41,12 @@ The handling program is launched with the desired selector as its only command
line argument, with the program name stripped off the front. So if the client
asked for "music/pop/taylor_swift" then the daemon runs something like...

export GOPHERSPACE=/gopherspace
export GOPHERHOST=gopher.icculus.org
export GOPHERPORT=70
/gopherspace/music pop/taylor_swift
```bash
export GOPHERSPACE=/gopherspace
export GOPHERHOST=gopher.icculus.org
export GOPHERPORT=70
/gopherspace/music pop/taylor_swift
```

...and what the handler does is entirely up to it. Note that handlers are
expected to transmit well-formed Gopher responses. It's not a complicated
Expand Down

0 comments on commit adf5149

Please sign in to comment.