navanchauhan/swift-gopher
```
Get Started
git clone https://github.com/navanchauhan
cd swift-gopher
swift build -c release && swift run swift-gopherThen, you can either use lynx or curl (or other Gopher clients) to connect to the server.
lynx gopher://localhost:8080
# Or,
curl gopher://localhost:8080Note: Depending on user privileges, you may not be able to bind to port 70.
To give privilege to the binary on Linux, you can use the following command:
sudo setcap CAP_NET_BIND_SERVICE=+eip ./.build/release/swift-gopherYou can also refer to the systemd file below to grant the binary the same privileges
Deploying
Systemd
Sample systemd file:
[Unit]
Description=Swift-Gopher
[Service]
ExecStart=/home/swift-gopher/swift-gopher/.build/release/swift-gopher --port 70 --gopher-host-name gopher.navan.dev --gopher-data-dir /home/swift-gopher/gopher_data
User=swift-gopher
Group=swift-gopher
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
[Install]
WantedBy=multi-user.targetHTTP Proxy
Although, swift-gopher does not currently have a native HTTP handler, you can use self host some of the following packages to proxy the Gopher server to HTTP:
- gophper-proxy + Caddy is what I use to host the HTTPS version of my Gopher server at https://gopher.navan.dev
- gopher-proxy
- gopherproxy-c
TODO:
- [ ] Add Tests
- [ ] Add CI
- [x] Add more documentation
- [ ] Automatic Versioning
- [ ] Verify Compatibility with other Gopher Clients
- [ ] Support Gemini Protocol
- [x] Add a client library
- [ ] Add native HTTP handler
- [ ] Guestbook
Generating Docs
./generate_docs.sh swiftGopherClient swift-gopher GopherHelpersReference Documentation
Reference Documentation is hosted at https://web.navan.dev/swift-gopher
Package Metadata
Repository: navanchauhan/swift-gopher
Default branch: master
README: README.md