Staying Connected in the Background
Why iOS kills your MUD connection, what we tried before, and how we actually fixed it.
You are deep in a dungeon. A party member sends you a tell. You switch to Safari to look up a map. Thirty seconds later you come back and your connection is gone.
If you have used a MUD client on iOS, you know this pain. It has been the biggest frustration since the App Store launched. It is not one app bug. It is how iOS works.
The Problem
When you leave an app on iOS, the system suspends it within about 30 seconds. CPU stops. Timers stop. Network sockets are closed. Your telnet connection to the MUD server is dropped.
This is by design. Apple does it to save battery and memory. There is no official API to keep a raw TCP socket alive in the background on iOS.
What MUDRammer Did
MUDRammer used a VoIP-era workaround, marking the stream with
kCFStreamNetworkServiceTypeVoIP. That let iOS keep the socket alive for
background call apps.
It worked for years. Then Apple tightened policy. The flag was deprecated in iOS 9, unreliable by iOS 16, and not allowed for this use on iOS 17 and later.
The old VoIP trick
- Deprecated since iOS 9
- Broken on iOS 16 and later
- Rejected by App Review on iOS 17
- No recovery path if the socket drops
- No push-driven event alerts
MUDBasher proxy
- Uses Apple-approved APIs
- Built for iOS 17 and newer behaviour
- Session survives any background duration
- Missed output buffered and replayed
- Push notifications for important events
How MUDBasher Solves It
We do not fight iOS lifecycle rules. We move the persistent connection off your phone.
Your device talks to a lightweight MUDBasher proxy service over WebSocket. The proxy maintains the real telnet connection to your MUD server continuously.
When you background the app:
- 0 seconds
- You switch apps. iOS grants a short background window.
- About 30 seconds
- MUDBasher is suspended. The phone-to-proxy socket drops. The proxy-to-MUD socket stays alive.
- While away
- The proxy buffers incoming output with sequence numbers.
- Push notification
- Critical events can trigger push alerts to your lock screen.
- Return to app
- The client reconnects and asks for everything after the last seen sequence number. The proxy replays in order.
Background sync
Silent pushes wake the app briefly so it can fetch buffered output in short sync windows. On supported devices, Live Activities can also surface status and recent text.
What you do not lose
Tells, chat, combat, room output, and protocol data are captured while you are away. Reconnecting resumes exactly from your last acknowledged sequence.
Sessions remain alive on the proxy for up to 24 hours without an attached foreground client.
Limitations
Background behaviour is not desktop-equivalent real time. Output syncs in bursts when the app wakes or when you reopen it.
Apple controls background wake budgets and push delivery. Most alerts are timely, but delivery is best effort.
Idle proxy sessions expire after 24 hours to prevent stale ghost connections.
For the Technically Curious
The proxy is Node.js based: WebSocket on the client side, telnet on the server side, with protocol negotiation and replay buffer sequencing.
Session auth uses per-session tokens, buffered output is replayed by sequence number, and APNS integration handles event notifications with server-side rate limiting.
Proxy connections are optional and set per world. A world left on a direct connection talks to its MUD straight from your device. See the privacy policy for what the proxy handles when you do use it.
MUDBasher, background connection persistence.