P2P Direct Transfer WebRTC

Send files, chat messages, and make video calls directly between two agents using WebRTC. The NFLTR server handles signaling only — actual data flows peer-to-peer. Zero data touches the server.


How It Works

NFLTR uses `WebRTC` data channels for file transfer and chat, and WebRTC media tracks for video/audio. The server provides signaling (SDP offer/answer exchange) over the existing gRPC connections, then steps aside. STUN handles NAT traversal automatically.

AGENT A — SENDER Behind corporate NAT nfltr p2p send ... NFLTR SERVER Signaling only SDP offer/answer relay AGENT B — RECEIVER Behind home NAT nfltr p2p recv ↑ Signaling (steps 1-2) DIRECT P2P — WebRTC Data Channel AES-256-GCM encrypted • STUN NAT traversal • no server relay Files │ Chat │ Video │ Audio ↓ Direct data flow (step 3+)

Modes

File Transfer

# Send a file peer-to-peer
nfltr p2p send report.pdf agent-b

# Send a directory
nfltr p2p send ./build-output/ agent-b

# Receive files (on Agent B)
nfltr p2p recv --output ./downloads/

Chat

# Start an encrypted P2P chat
nfltr p2p chat agent-b

# Interactive terminal chat with typing indicators
# All messages go directly between agents

Video Call

# Start a P2P video call
nfltr p2p call agent-b

# Opens a local browser window with WebRTC video/audio
# Direct peer connection — zero server relay

How It Differs from A2A

Feature A2A Messaging P2P Direct
Data pathThrough serverDirect peer-to-peer
ProtocolgRPCWebRTC
Best forSmall messages, commandsLarge files, media
Server sees dataYes (encrypted in transit)No — signaling only
Video/audioNot supportedFull WebRTC media
NAT traversalVia server relaySTUN/ICE direct

Security

🔐 E2E Encrypted

WebRTC DTLS + SRTP encryption. AES-256-GCM for data channels. The server cannot decrypt any transferred data.

🔑 Mutual Auth

Both agents authenticate via HMAC before establishing the WebRTC connection. No anonymous peers.

🌐 STUN Traversal

Built-in STUN client discovers public IP and port mappings. Works behind most NAT types.

📊 Zero Knowledge

The server only sees signaling metadata. File contents, chat messages, and video streams never leave the direct connection.

💡 Fallback to server relay

If direct P2P fails (symmetric NAT on both sides), NFLTR falls back to end-to-end encrypted relay through the server. The data is still encrypted — the server cannot read it.

Use Cases

Transfer files directly — no server in the middle

WebRTC-powered peer-to-peer with automatic NAT traversal.

CLI Reference E2E Encryption →