Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Share your connection

spora share turns your machine into the exit for someone you trust. By default the client connects straight to it, which suits a machine with a public address, such as a server. Behind a NAT, share through a relay instead: the sharer registers with it, and the client reaches it through the relay until a direct path is punched.

spora share

Your share URL is a credential

The printed https://spora.to/s/… link is the whole secret: whoever has it can route traffic through your connection. Send it over a channel you trust, and to people you trust. If it leaks, run spora share --fresh to make a new share (and a new URL); the old link stops working.

The URL stays stable across restarts because the share behind it is kept at ~/.config/spora/share.bin, made under this machine’s device identity (in ~/.local/state/spora/service/). Keep several shares with --share-file. The relays are part of the share and of its URL: running with other relay flags than the share was made with makes a new share, with a new URL.

Without relay flags, a new share is relay-less. The first run asks STUN services which public address this machine reaches the internet from, picks a random UDP port between 10000 and 32767, and puts both in the URL (an IPv6 address as well, where the machine has one). Every run prints the port, and a firewall in the way must let it in. If the public address is not one of the machine’s own, the run says it is behind a NAT: clients then get in only if the NAT forwards that port to it, as a cloud server’s usually does. An address family whose NAT changes the port is left out of the URL, as long as another family remains. --direct host:port names the address and port instead (a hostname, or a port your firewall already lets in). The address is fixed when the share is made, so every later run without relay flags asks STUN again once the share is up, and warns if the machine now reaches the internet from another address than the URL names; spora share --fresh then makes a share on the new one.

To share through relays instead, pass --spora-relays for Spora’s relays: the first run registers this machine with Spora’s API and gets the relays from it, with the token those relays want, which the CLI then renews while it runs. Or pass --relay (and --relay-token for a relay that wants one) to use relays of your own; see Run your own relay.

One share serves one client at a time. If a second client connects with the same URL, it replaces the first.

The connection log

You carry someone else’s traffic, so the CLI keeps a local, private record of what your connection was used for: which client session reached which destination IP and port, when, and how much data moved. If your IP is ever implicated in something you did not do, this is your answer to “what actually happened”.

spora log query --ip 203.0.113.5 --from 2026-08-01 --to 2026-08-28
spora log sessions

The log lives at ~/.local/state/spora/connlog/<routing-key>/ (in root’s home for a share run with sudo, such as --os-routing below: read that one with sudo spora log), keeps 90 days by default (--conn-log-retention-days), and never leaves your machine. A new share (after --fresh, or with other relays) gets a log of its own beside the old one, which stays; every spora share keeps sweeping the old logs there by the retention each was kept with. spora log hold pins a time range against retention if you have been asked to preserve records. --no-conn-log disables logging entirely, which also means you will have no record of what clients did with your IP. --conn-log-sessions-only records who was connected and when, without per-destination detail.

Be aware of the limits: destinations are IPs, not names, and a session that stayed on the relay path never directly observes the client’s own address. The log states what kind of evidence each recorded address is.

Your client’s DNS

By default the client resolves names through you. Its queries arrive at a resolver address inside the tunnel (100.64.0.53), and the share answers them from the resolvers your own machine uses (/etc/resolv.conf; the adapters’ DNS servers on Windows), forwarding each query verbatim to one of them and the answer verbatim back. The client never learns those addresses, and it still cannot reach anything else on your LAN. Should your resolvers stop answering, the share falls back to public ones (8.8.8.8, 1.1.1.1) until they recover. spora share prints which resolvers it is forwarding to.

--dns-upstream <ip[:port]> (repeatable) forwards to these servers instead, and only to them: no public fallback. --no-dns-forwarder switches the forwarding off; the client then needs public resolvers of its own (spora use --dns).

Known limitation: if your system resolves over encrypted DNS configured in the OS itself (DNS over TLS or HTTPS on Android, macOS, iOS or Windows, as opposed to a local stub such as systemd-resolved doing it on the machine’s behalf), the share still sends the client’s queries in plain UDP to the same servers. They resolve, but not over the encrypted transport you chose. With --os-routing the forwarder is wired in through a DNAT rule, so it is unavailable under --no-nat.

Running it permanently

The share is a single foreground process, so a systemd unit is all it takes:

[Unit]
Description=Spora share
After=network-online.target

[Service]
ExecStart=/usr/local/bin/spora share
Restart=on-failure
User=spora

[Install]
WantedBy=multi-user.target

systemctl stop sends SIGTERM, which the CLI handles cleanly, as it does Ctrl+C and the SIGHUP of a closed terminal or a dropped SSH session.

The kernel exit

By default the sharer terminates client flows in a userland network stack and re-originates them from ordinary sockets. That needs no privileges and works everywhere. On Linux you can instead let the kernel route and NAT the client’s packets through a TUN device:

sudo spora share --os-routing

This performs better under load and behaves like a router rather than a proxy. It changes the firewall (iptables) and sysctls while running and undoes those changes on exit. See spora share --help for the --tun-addr, --tun-mtu, and --no-nat knobs.