MUDBasher

Staying Connected in the Background

Why iOS kills your MUD connection, what we tried before, and how we actually fixed it.

You're 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've used a MUD client on iOS, you know this pain. It has been the biggest frustration since the App Store launched. It's not one app bug. It's 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 happens when you switch apps
Your iPhone
-x-
Connection killed
-x-
MUD Server

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+.

The Old VoIP Trick

  • Deprecated since iOS 9
  • Broken on iOS 16+
  • Rejected by App Review on iOS 17
  • No recovery path if socket drops
  • No push-driven event alerts

MUDBasher Proxy

  • Uses Apple-approved APIs
  • Built for iOS 17 and newer behavior
  • Session survives any background duration
  • Missed output buffered and replayed
  • Push notifications for important events

How MUDBasher Solves It

We don't 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.

Proxy architecture
Your iPhone
<- wss ->
MUDBasher Proxy
<- tcp ->
MUD Server

When you background the app:

0 seconds
You switch apps. iOS grants a short background window.
~30 seconds
MUDBasher is suspended. Phone-to-proxy socket drops. Proxy-to-MUD socket stays alive.
While away
Proxy buffers incoming output with sequence numbers.
Push notification
Critical events can trigger push alerts to your lock screen.
Return to app
Client reconnects and asks for everything after the last seen sequence number. 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 don't lose

Tells, chat, combat, room output, and protocol data are captured while you're away. Reconnect resumes exactly from your last acknowledged sequence.

Sessions remain alive on the proxy for up to 24 hours without an attached foreground client.

No extra setup required. Use a proxy-enabled world in MUDBasher and this behavior is automatic.

Limitations

Background behavior 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.