Auto-Connect Phone and PC Like AirDrop Using P2P

Learn how persistent pairing and WebRTC tunnels allow your phone and PC to connect automatically over local Wi-Fi like AirDrop.

Quick Answer & Key Solution

Direct Solution: Learn how persistent pairing and WebRTC tunnels allow your phone and PC to connect automatically over local Wi-Fi like AirDrop.

3-Step Instant Guide:
  1. Open Textunnel.com in your browser on both sending and receiving devices.
  2. Scan the pairing QR code or enter the 6-digit room key to connect over local Wi-Fi.
  3. Select your files or paste clipboard text for direct, encrypted peer-to-peer transfer at maximum speed.
Textunnel Team
Updated: Jul 12, 2026
3 min read
Blog
Share
Textunnel No login required
End-to-end encrypted
Works everywhere
100% free

If you've ever used browser-based file sharing tools (like Snapdrop, PairDrop, or older versions of Textunnel), you know the drill:

  1. Open the website on your PC.
  2. Open the website on your phone.
  3. Look at the screen to find a 6-digit room code.
  4. Type the room code into the other device to connect.

While this is miles better than emailing yourself a file, it still has friction. Apple's AirDrop doesn't ask you for a 6-digit code. Why should your browser-based sharing tool?

Today, we are thrilled to announce Seamless Persistent Device Pairing for Textunnel.

The Problem with Traditional WebRTC Signaling

WebRTC is the magic underlying technology that allows browsers to send files directly to each other without touching a cloud server. However, WebRTC requires a "Signaling Server" (like our MQTT broker) to help the two devices find each other's IP addresses.

Usually, developers use a "Room Code" as the rendezvous point. If both devices subscribe to the topic Room-123456, they can find each other. But if you don't type the code, they are completely invisible to one another.

How Persistent Pairing Fixes This

We decided to engineer an entirely new discovery protocol. Here is how it works:

1. The Initial Trust Handshake

The very first time you connect your Mac and your iPhone via Textunnel (using a room code or QR code), they establish a secure WebRTC connection.

Behind the scenes, the devices silently exchange their anonymous deviceIds. Your Mac saves your iPhone's ID into its local storage, marking it as a "Trusted Peer".

2. The Personal Inbox (MQTT Auto-Discovery)

Now, the magic happens. The next time you open Textunnel on your Mac, it doesn't just sit there waiting for a room code.

Instead, it actively subscribes to a personal, hidden inbox: lan-drop/user/<Mac-ID>. At the exact same time, it sends out a silent "Ping" message to the inbox of every device it has ever trusted.

3. Click to Connect

If your iPhone happens to have Textunnel open, it receives the Mac's Ping and instantly replies with a Pong.

Suddenly, your iPhone appears on your Mac's screen under a new "My Devices" list with a glowing green "Online" indicator!

You just click your iPhone's icon, and Textunnel automatically:

  • Generates a cryptographically secure random room code.
  • Sends a silent "Invite" to your iPhone.
  • Forces both devices to instantly jump into the secure room and establish a WebRTC connection.

Why This Matters

This brings the "AirDrop Experience" to the open web.

  • No more typing codes.
  • No user accounts required. Your identity is tied cryptographically to your device's browser, not an email address or password.
  • Works across OS boundaries. Windows, Mac, iOS, Android, Linux—it doesn't matter. If they have a browser, they can auto-pair.

Try It Now

Ready to experience it? Open Textunnel on your computer and your phone. Connect them once manually. Then, close the tabs, reopen them, and watch them automatically discover each other!

Textunnel

Experience Direct Cross-Device Transfer

Need to transfer large 4K files or sync clipboard text right now? Use the Textunnel Web App or check out our dedicated P2P File Sharing Tool and Cross-Device Clipboard Sync. No downloads, no logins, 100% free.

Browse All Tools
100,000+ Files Transferred
0 Server Storage
100% WebRTC Encrypted
Open Source & Free