Browser and npx
The webapp
The webapp at /app is a static site. It has no backend, no signalling server and no database. The browser connects straight to the producer.
| URL | Shows |
|---|---|
/app/files/<ticket> | The files of the share |
/app/info/<ticket> | The session and connection details |
/app/preview/<ticket>/<path> | One file |
The ticket is in the path, so each view is an ordinary link that you can send. From the home page of the webapp you can also create a share from a folder on your machine. That tab then acts as the producer.
The webapp needs a secure context (HTTPS or localhost). Without it, media previews cannot seek.
npx
npx agent-share <ticket> [destination] [--password <pw>]The npx receiver writes real files into destination (default ./share). It
does not mount, because NFS is native-only. AGENT_SHARE_PASSWORD works in
place of --password.
Node has no RTCPeerConnection, so the receiver uses the node-datachannel
native addon. To produce a share, use the native binary.
How a browser reaches a peer
A browser has no UDP socket and cannot speak QUIC. It reaches a native producer in two connections:
- It dials
agent-share/webrtc-signal/1over the iroh relay and swaps one WebRTC offer and answer. The relay carries the handshake, not file data. - It opens a new connection to
agent-share/mount/1over the WebRTC data channel.
Two connections are necessary. iroh sends the first packet of a connection to new paths only while no path is selected. So a live connection cannot move to a transport that is attached later.
If WebRTC fails, the mount fails. The browser does not fall back to the relay. See Networking for the full table.