Backpack Mode

The relay

Out of Bluetooth's reach, with both online, the Mac and the iPhone keep talking through a relay on the internet. One is built in. You can run your own.

iPhoneRelayMacsealed on one deviceopened on the otherstores and forwards what it cannot readnearby, Bluetooth instead

When it is used

Only while the phone's app is open: a few seconds after it finds no Mac nearby, or when the Mac goes out of Bluetooth's reach. The moment Bluetooth finds the Mac again, it goes back to Bluetooth. The top of the main screen says which: nearby, or through the internet.

Everything works through it except the Mac's screen, whose picture needs the Mac nearby. When the Mac has not checked in for a minute and a half (asleep, or offline), the phone says it is away and when it was last seen.

It cannot read anything

  • Every frame is sealed on one device with keys made from a secret only your pair holds, and opened only on the other. The relay stores and forwards bytes it cannot open, and it cannot pretend to be either side.
  • It keeps nothing for long: a frame the other side has not picked up within ten minutes is dropped.
  • What it does see: that your pair exists, the size and time of each frame, when the Mac last checked in, and the address each call came from.

The built-in relay

Nothing to set up: the Mac app uses it from the start, and tells the phone. It is run by the app's maker, with the same code as below.

Run your own

The relay is one small program with one SQLite file. It runs on any Linux or macOS machine with HTTPS in front of it.

  1. Make an enrollment key, the password that lets a Mac onto your relay:
    openssl rand -base64 32 > enroll-key
    chmod 600 enroll-key
  2. Run it, on the loopback address:
    backpack-relay -listen 127.0.0.1:8480 \
      -database relay.db -enroll-key-file enroll-key
  3. Put HTTPS in front. Answers must be allowed 30 seconds and bodies 2 MB. With Caddy:
    relay.example.com {
      reverse_proxy h2c://127.0.0.1:8480
    }
  4. Point your Mac at it, in Terminal, and paste the key when asked:
    backpack relay set https://relay.example.com
    The phone learns the address from the Mac the next time they connect; it never needs the key. backpack relay says how it stands.

Back to install and setup.