How scottdsnr/ssh-file-transfer works
fsi is a command-line file-transfer tool with two recipient paths: an encrypted CLI-to-CLI exchange and an explicitly unencrypted browser download page. The main workflow generates or accepts a spoken code, pairs peers through a relay (possibly hosted by the sender), authenticates and encrypts the CLI transfer, then verifies received files. The graph also shows direct hosting, optional Cloudflare tunneling, and the browser path. Some receiver and CLI wiring was not sampled; those links use documented package behavior and avoid uncertain internal sequencing.
Main entry points: transfer Transfer workflow · main.go fsi commands · host.go Embedded hosting · relay.go Peer rendezvous
Components 17
CLI and hosting
- fsi commands
cmd/fsi/main.go - Embedded hosting
cmd/fsi/host.go
Peer transfer
- Transfer workflow
internal/transfer - Code and room
internal/words/words.go - SPAKE2 handshake
internal/pake/pake.go - Message encryption
internal/crypt/crypt.go
Rendezvous transport
- Message framing
internal/comm/comm.go - WebSocket transport
internal/ws - Peer rendezvous
internal/relay/relay.go
Browser downloads
- Download page
internal/web/web.go
Other components
- Sender
- CLI recipient
- Browser recipient
- cloudflared
- Source files
- Received files
- Cloudflare tunnel
Connections 22
- Sender → fsi commands: runs send
- CLI recipient → fsi commands: runs receive
- fsi commands → Code and room: generates code
- fsi commands → Embedded hosting: starts hosting
- fsi commands → Transfer workflow: starts transfer
- Embedded hosting → Peer rendezvous: starts relay
- Embedded hosting → cloudflared: starts tunnel
- cloudflared → Peer rendezvous: forwards HTTP
- Transfer workflow → Code and room: derives room
- Transfer workflow → Message framing: dials and exchanges
- Transfer workflow → SPAKE2 handshake: authenticates peers
- Transfer workflow → Message encryption: seals frames
- Transfer workflow → Source files: reads and hashes
- Transfer workflow → Received files: writes verified files
- Message framing → WebSocket transport: uses for URL transport
- Peer rendezvous → Message framing: pairs and pipes
- Peer rendezvous → WebSocket transport: accepts upgrades
- Sender → Browser recipient: shares download link
- fsi commands → Download page: serves browser path
- Download page → Source files: reads and serves
- Browser recipient → Download page: requests downloads
- Embedded hosting → Download page: mounts handler