← Collaboration overview

🌐 WAN Live Session

Same realtime co-editing as LAN Live, but across the internet. WebRTC carries the data with DTLS encryption. A tiny Cloudflare Worker handles the introduction (rendezvous), then the peers talk directly - the Worker never sees your MIDI traffic. Up to 8 joiners per session.

PC 1 - Host
Edits flow over WebRTC + DTLS
PC 2 - Joiner
Sees host's edits over the internet

Two screen captures from a real WAN session over the internet. Same ~200 ms tick rate as LAN, plus the round-trip latency of your link.


When to use it

WAN Live is for everyone not on the same LAN: remote bandmate, friend in another city, classroom-from-home. Up to 8 joiners per session (host + 7 others). The same diff/apply pipeline as LAN, so the editing experience is identical - just routed through a Cloudflare Worker for the initial handshake and then peer-to-peer over DTLS-encrypted WebRTC.

For users on the same network, prefer LAN Live Session - same UX, no internet involved, lowest possible latency.


Quick start

  1. Host opens a MIDI file, picks Collab → Start WAN Live Session….
  2. A 4-character code appears. Click Copy invite to grab a paste-ready message.
  3. Each joiner picks Collab → Join WAN Live Session… and types the code.
  4. ~5-10 s of ICE / DTLS handshake, then everyone is connected. Status bar shows LIVE [Online] · N peer(s).

Connection Test

Open Settings → Collaboration → Test connection before starting a real session. The test runs in three stages:

  1. Pre-flight ping - GET /health against your configured rendezvous URL. 5-second timeout. Surfaces unreachable servers / firewall blocks within seconds.
  2. Rendezvous round-trip - posts a session, receives a code, the in-process "peer" verifies the code, posts an offer, the "host" reads it.
  3. WebRTC loopback - both transports run inside this same process, do an ICE / DTLS handshake against each other via local host candidates, then send a single ping/pong frame.

The result is one of four buckets:

Connection looks great

Rendezvous fast, handshake clean. Real WAN sessions will work.

Connection works, slower than expected

Successful but rendezvous or handshake took longer than 3 s. Real sessions still work; consider raising ICE timeout if your network is consistently slow.

Test inconclusive

Rendezvous worked but the WebRTC loopback didn't. Most often this is NAT hairpinning - some routers don't loop their own public IP back to themselves. Real two-PC sessions usually still work. Verify by hosting on one PC and joining from another.

Connection failed

Either the rendezvous is unreachable (URL wrong, firewall block, DNS) or the WebRTC stack couldn't bind locally. The dialog includes a specific failure stage and reason - usually the firewall, see below.

The test is non-destructive and can be re-run any time you change network settings. With Collab disabled, the button stays clickable so you can verify your setup before opting in.


ICE, STUN, gathering timeout

WebRTC needs to discover candidate IP/port pairs that two peers can use to reach each other. That's ICE (Interactive Connectivity Establishment), and it relies on a STUN server to learn each peer's public IP. MidiEditor ships with a default list of free public STUN endpoints (Google's). For 95% of home / office connections that's all you need.

The ICE timeout setting (default 8 s) caps how long gathering can take before MidiEditor publishes the SDP with whichever candidates it has. Slow / blocked STUN endpoints can stall gathering otherwise; raising this to 12-15 s may help on flaky connections.

TURN servers (which actually relay traffic when peer-to-peer fails) are not in the bundled list. They cost real bandwidth and we don't pay for one by default. Symmetric NATs (rare on home networks, common on some mobile carriers and VPNs) require a TURN; you can run your own (e.g. Coturn) and add the URL to the rendezvous configuration. See Adding a TURN server.


Auto-reconnect

When enabled (off by default), a transport failure during a Live Session triggers an automatic re-handshake on the same code, up to Max retry attempts times. Useful for transient flaps - Wi-Fi roam, brief ISP hiccup. Doesn't help when the host restarts and gets a new code; in that case the joiner has to re-enter the new code manually.

A dropped peer never affects the others - reconnection is per-peer. A failed retry on one joiner doesn't kick everyone else.


Rendezvous

The Cloudflare Worker is a tiny key-value mailbox. Each session is one short-lived record (5-minute TTL). Joiners post their offer SDPs to the Worker; the host polls a list of pending offers and replies with an answer SDP per joiner. Once both sides have each other's SDP, ICE finds a path between them and DTLS handshakes peer-to-peer - the Worker isn't in the path anymore.

The default URL ships with the build and is shared across all users. For heavier use, custom domains, or full uptime control, deploy your own - see Self-host the Cloudflare rendezvous. Setup takes about five minutes and the free tier covers ~100k sessions/day.


Recovery scenarios


Troubleshooting

"Connection works in browser but not in MidiEditor"

The classic silent firewall block: the rendezvous URL opens fine in a browser (or returns JSON via PowerShell Invoke-WebRequest), but the Connection Test inside MidiEditor times out after 5 s with no specific error. On Windows this almost always means the OS firewall is silently dropping outbound HTTPS from the app without showing the usual "allow this app to access network" prompt.

Fix on Windows:

  1. Windows Security → Firewall & network protection → "Allow an app through firewall"
  2. Click Change settings, then Allow another app…
  3. Browse to MidiEditorAI.exe (where you installed the app)
  4. Add it, then check both Private and Public boxes

Fix when third-party antivirus is involved (Bitdefender, Norton, Kaspersky, McAfee, ESET, etc.): each AV has its own "Application Control" or firewall list. Add an exception for MidiEditorAI.exe there as well. AV-side blocks often happen without any visible prompt because the AV's "trusted apps" filter only allows signed / well-known executables by default.

Future MidiEditor releases may be code-signed, which usually eliminates the silent-block behaviour on Windows. For unsigned development builds, the firewall exception is a one-time setup.

Other common errors

"Couldn't reach rendezvous" / Connection Test reports health failed:

"ICE failed" / handshake never completes:

"Connected but no edits flow":

"This code has already been used" / 409 from rendezvous:

"Session is full" / 503 from rendezvous:

Connection Test "Inconclusive":