MUD Keep-Alive Proxy
A lightweight proxy that keeps your MUD connection alive when your client disconnects. No more losing your session.
Why You Need a Proxy
Playing a MUD from your phone or over WiFi? Disconnections are inevitable. Every time you lose your connection, you have to re-login, re-orient, and hope nothing bad happened to your character while you were gone.
Persistent Connection
The proxy keeps your MUD connection alive even when your client disconnects. Your character stays in-game.
Auto-Resume
When you reconnect, the proxy replays any output you missed and picks up right where you left off.
Keepalive Pings
Periodic keepalive commands prevent the MUD server from kicking you for being idle.
Zero Dependencies
A single Python file. No pip install, no Docker, no configuration files. Edit three lines and run.
How It Works
MUD Client → Proxy (your machine) → MUD Server
Client disconnects:
MUD Client X Proxy ↔ MUD Server
└ buffers output, sends keepalives
Client reconnects:
MUD Client → Proxy ↔ MUD Server
└ replays missed output, resumes session
Get the Proxy
One Python file. No installation required. Works on macOS, Linux, and Windows.
Requires Python 3.8+ — verify with python3 --version
Quick Start Guide
1. Configure
Open mud_proxy.py in any text editor and change the server settings near the top:
MUD_HOST = "your-mud-server.com"
MUD_PORT = 4000
# The local port your MUD client connects to
PROXY_PORT = 4000
# How often to send a keepalive (seconds, 0 to disable)
KEEPALIVE_INTERVAL = 120
2. Run
[2025-01-01 12:00:00] INFO MUD Keep-Alive Proxy v1.0.0 started
[2025-01-01 12:00:00] INFO Listening on ('0.0.0.0', 4000)
[2025-01-01 12:00:00] INFO Forwarding to your-mud-server.com:4000
[2025-01-01 12:00:00] INFO Ready for connections.
3. Connect
Point your MUD client at the proxy instead of the MUD server directly:
If the proxy is running on a different machine, use that machine's IP address instead of localhost.
Using with MUD Portal
MUD Portal is a free MUD client for iPhone. Combined with this proxy, you get persistent sessions that survive app switches, screen locks, and network changes.
- Run the proxy on a machine that stays online (home server, VPS, or always-on desktop)
- In MUD Portal, create a server entry pointing to your proxy machine's IP and port
- Play normally — the proxy is fully transparent
- If your phone goes to sleep or you switch apps, the proxy keeps your MUD session alive
- When MUD Portal reconnects, missed output is replayed automatically
Running as a Background Service
For always-on operation, run the proxy in the background using one of these methods.
screen (macOS / Linux)
# Detach: Ctrl+A, then D
# Reattach: screen -r mudproxy
tmux (macOS / Linux)
# Detach: Ctrl+B, then D
# Reattach: tmux attach -t mudproxy
systemd (Linux)
Description=MUD Keep-Alive Proxy
After=network.target
[Service]
Type=simple
User=your-username
ExecStart=/usr/bin/python3 /path/to/mud_proxy.py
Restart=on-failure
[Install]
WantedBy=multi-user.target
$ sudo systemctl enable mud-proxy
$ sudo systemctl start mud-proxy
$ sudo systemctl status mud-proxy
Configuration Options
| Setting | Default | Description |
|---|---|---|
MUD_HOST |
your-mud-server.com |
Hostname or IP of the MUD server |
MUD_PORT |
4000 |
Port of the MUD server |
PROXY_PORT |
4000 |
Port your MUD client connects to |
KEEPALIVE_INTERVAL |
120 |
Seconds between keepalive pings (0 to disable) |
KEEPALIVE_COMMAND |
"" (empty) |
Command sent as keepalive. Try "idle" or "look" if empty line doesn't work. |
ORPHAN_TIMEOUT_MINUTES |
60 |
Minutes to keep MUD connection alive after client disconnects |
BUFFER_MAX_KB |
64 |
Max KB of output to buffer while client is disconnected |
MAX_CONNECTIONS |
10 |
Maximum simultaneous client connections |
LOG_LEVEL |
INFO |
Logging verbosity: DEBUG, INFO, WARNING, ERROR |