Skip to main content
Back to Docs

> Connection Modes

LAN, USB/ADB, and peer-to-peer WebRTC — how Morpheus connects your devices.

LAN (Local Network)

The default and fastest connection mode. Both devices must be on the same WiFi network. The agent listens on port 3847 and the mobile app connects directly via the local IP address.

ws://192.168.1.42:3847

LAN connections have the lowest latency and highest reliability. This is the recommended mode for home and office use.

USB / ADB (Android)

For Android devices, you can connect over USB using ADB port forwarding. This is useful when WiFi is unavailable or unreliable.

Setup

  1. Enable Developer Options and USB Debugging on your Android device.
  2. Connect via USB cable and authorize the computer.
  3. Run the port forward command:
    $ adb forward tcp:3847 tcp:3847
  4. The mobile app connects to ws://127.0.0.1:3847.

Remote Access via Peer-to-Peer WebRTC

PRO When your phone leaves the agent's LAN, Morpheus establishes a direct peer-to-peer WebRTC data channel between the two devices — no tunneling service, no proxy, no vendor in the hot path.

  • Signaling: SDP offer/answer and ICE candidates are signed with the pairing shared secret and relayed through Supabase Realtime. The relay sees only opaque signed envelopes.
  • NAT traversal: Google public STUN for most networks; Open Relay TURN fallback only when both sides are behind symmetric NATs.
  • Encryption: DTLS-SRTP at the WebRTC layer plus Morpheus's own TweetNaCl at the application layer. End-to-end, no middle box.
  • No port forwarding, no static IP, no long-lived tunnel.

Connection Fallback Order

When connecting, the mobile app tries each mode in order and uses the first one that succeeds:

  1. LAN IP ws://192.168.x.x:3847
  2. USB / ADB ws://127.0.0.1:3847
  3. WebRTC (P2P) — direct data channel via Supabase signaling

This happens automatically and fails over on network transitions (WiFi↔cellular) within a couple of seconds. No manual configuration is needed unless you want to force a specific mode in settings.

Troubleshooting Connections

Firewall blocking port 3847

Ensure your firewall allows inbound connections on TCP port 3847. On macOS, you may need to allow Morpheus in System Settings → Privacy & Security → Firewall.

Devices on different subnets

Some routers isolate WiFi clients (AP isolation). Ensure both devices are on the same subnet. Guest networks typically isolate clients — use the main network instead.

ADB not detecting device

Verify USB debugging is enabled in Android Developer Options. Run adb devices to confirm the device is listed. If not, try a different USB cable or port.