Skip to main content
Back to Docs

> Connection Modes

LAN, USB/ADB, and an operated relay — 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 the Relay

PRO When your phone leaves the agent's LAN, Morpheus reaches it through a relay server we operate — so remote control works from any network, with no port forwarding or setup.

  • Outbound by design: the desktop holds a persistent outbound connection to the relay, so your machine is never exposed to inbound connections from the internet — NAT and CGNAT are non-issues.
  • Encryption: the relay forwards only opaque, already-encrypted frames. Everything stays end-to-end encrypted with TweetNaCl using the secret established at pairing — the relay cannot read your traffic.
  • Metadata only: the relay processes connection metadata (device identifier, IP, timestamps) to route traffic; message payloads are never logged.
  • Prefer LAN automatically when reachable; set RELAY_URL='' on the desktop to run LAN-only.

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. Relay (Remote) — operated relay over wss://, end-to-end encrypted

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.