Choosing a transport

Changing transports does not change the CapTP session. It changes who you can reach and what the path between you proves.

TransportNetwork trustUse it forWhat the path proves
irohUntrustedPeers outside the browser that need discovery or NAT traversal, and Spritely Goblins through glowcap’s adapterThe node id is a key, so dialing it proves who answered. QUIC encrypts the channel.
webrtcUntrustedBrowsers talking directlyThe DataChannel is encrypted. Who the peer is is vouched for by the signaling service that introduced it.
noise-tcpUntrustedglowcap peers with a direct TCP routeThe Noise handshake proves the dialed key and seals the stream end to end. Interoperability with another CapTP implementation is untested.
noise-relayUntrustedglowcap peers, sealed, through a relayThe same Noise handshake, peer to peer. The relay only sees ciphertext.
onionUntrustedConnecting to Goblins as shipped, on the standardized pathTor proves you reached the service you dialed and hides where both ends are. It proves this only to the dialing side, inside the Tor daemon, so glowcap does not treat it as proof of who the CapTP peer is.
keyed-tcpTrusted onlyA stable key name on a network you already trustDialing demands that key, but nothing proves possession, and the frames are cleartext.
keyed-relayTrusted onlyPeers through a relay, cleartextSame key demand. The relay reads every frame, and nothing proves who is on the far side.
tcpTesting onlyCleartext testing against Goblins, through glowcap’s adapterA host:port. Nothing is proved and nothing is encrypted.
inprocTesting onlyBoth peers in one processNo network between them, so nothing to prove and nothing to encrypt.

Browser traffic

A browser cannot open raw TCP or iroh QUIC. It has two choices:

  • WebRTC opens a direct encrypted DataChannel, usually between two browsers. Both peers need a shared signaling capability to trade connection details, and ICE (the browser’s path finding) must find a route. Across the open internet it may also need STUN or TURN servers, which help cross a NAT.
  • A WebSocket relay carries a browser connection to a registered peer, or dials a TCP or iroh peer for it. A noise-relay registration keeps traffic encrypted between peers. When the relay dials iroh, it can read the traffic and vouches for the peer’s key.

The relay is simpler to run. Add WebRTC when direct browser-to-browser traffic is worth the extra signaling and NAT work.

Similar transports

  • keyed-tcp, noise-tcp, and iroh all name a peer by key. noise-tcp and iroh encrypt and authenticate. Only iroh adds discovery and NAT traversal.
  • iroh and WebRTC are both encrypted peer-to-peer channels. iroh is the non-browser path. WebRTC is the browser path.
  • tcp and keyed-tcp use the same sockets. tcp names an address. keyed-tcp names an identity and carries the address as a hint.
  • Three paths reach Goblins. onion is the transport the OCapN draft standardizes and the one Goblins ships. tcp and iroh reach Goblins through adapters glowcap provides: cleartext loopback, and encrypted QUIC.

id bundles several of these routes under one durable key. It is a locator format rather than a transport. Multi-home peers explains it.

Setup lives on the Noise, iroh, WebRTC, onion, and relay pages. Transports explains how each symbol names a peer.