{"canonical_url":"https://engineer.company/glossary/tor/","content_markdown":"# Tor\n\n## What it is\n\nTor keeps the question of who is talking to whom away from anyone watching the wire, by passing\neach connection through a chain of machines so that none of them learns both where the traffic\nstarted and where it ends. The chain is chosen by the client, a program called tor that runs on\nthe reader's own computer, and it is usually three relays long: a guard that the client keeps\nreusing as its way in, a middle relay, and an exit that makes the final connection to the\ndestination. The client builds this circuit one hop at a time and agrees a separate key with each\nrelay, then wraps every piece of data in one layer of encryption per hop. Each relay removes its\nown layer and learns only the neighbour before it and the neighbour after it. Those nested layers\nare the onion in the title of the design paper, The Second-Generation Onion Router. In\nconversation the relays as a whole are the Tor network, tor in lower case is the program, and Tor\nBrowser is the browser packaged to use it.\n\nData moves in cells of a fixed size, so a relay sees a stream of uniform blocks rather than the\nshape of the original packets. Several TCP streams can share a circuit when their isolation\nrequirements are compatible. The client builds circuits both in advance and on demand, and\nretires them according to age and use; a long-lived stream can remain on its original circuit,\nand some isolation settings allow longer reuse. Applications reach the client through a local\nSOCKS proxy, and only TCP travels this way; the design paper states plainly that it does not\ntunnel protocols such as UDP. Volunteers run the relays, each publishing a descriptor with its\nkeys, address, bandwidth and exit policy; a small set of directory authorities votes on which to\nlist and signs the result as a consensus document that every client fetches before picking a path.\n\n## Why it matters\n\nFor anyone who runs a public website, Tor is first a fact about the audience. A reader who arrives\nover Tor appears to come from an exit relay's address rather than their own, and the list of\nrelays is public by design, because every client needs it to choose a path. A site can therefore\nrecognise Tor traffic and treat it differently. The Tor Project's own position is that operators\nhave the right to block it, even if it hopes they will not. The decision that remains is what to\ndo with those readers: serve them like everyone else, slow them down, put a challenge in front of\nthem, or give them a way in that never leaves the Tor network at all, which is what an onion\naddress does.\n\nIt pays to be exact about what Tor promises, because its design paper lists what it leaves out. It\ndoes not claim to defeat an observer who can watch both ends of a connection and compare timing\nand volume, and the project's documentation adds that researchers know no practical low-latency\ndesign that reliably does. The basic protocol does not conceal Tor use itself; bridges with\npluggable transports add ways to disguise that traffic. And Tor does not encrypt the last stretch,\nfrom the exit relay to the destination: the application needs encryption of its own for that hop.\n\nSet beside a VPN, the trust is arranged differently. A VPN provider sees both the user and the\ndestination and is asked to look away. On Tor no single relay sees both. For most paths, the\nselection rules keep relays from the same declared family apart and avoid a shared IPv4 /16 or\nIPv6 /32 subnet by default; there are documented exceptions and configurable subnet limits.\nThe price is latency, since an ordinary exit circuit crosses three volunteer machines, so pages\nthat are light and need few round trips serve Tor readers best. Offering an onion address needs\na tor process and a private key to guard, but no open inbound port, which is why it fits on small\ninfrastructure.\n\n## What it looks like in practice\n\nThe company's own site can be read over Tor. The [command-line page](/cli/) publishes the onion\naddress next to a `curl` command that fetches the Markdown text through a local tor client. The\naddress is deliberately plain `http://`: a version 3 onion address encodes the service's identity\npublic key together with a checksum and version byte. Tor authenticates the service and encrypts\nthe circuit before HTTP is spoken. A public web certificate is not needed for that onion-address\nauthentication.\n\nAn onion service needed room for a tor process on the company's September 2026 public-services\nhost: a single core with about 464 MB of usable memory that already terminated TLS for seven\ndomains and ran a git forge. Room for that process was measured rather than argued, over\n[a recorded day of samples on that 512 MB host](/portfolio/a-whole-company-on-one-small-server/):\nthe smallest amount of available memory seen was about 310 MB of the 464, swap use was 2.6 per\ncent and the processor sat idle 99.7 per cent of the time, so Tor went on beside the rest.\n\nThe [privacy notice](/privacy/) records the company's choice about counting readers. The Gemini and Gopher applications keep no access log, and their daily counters\nrecord only aggregate request totals. Gopher also has an operating-system connection log\ncontaining the source address; that log expires after 30 days. Over Tor the\ncompany says it counts nothing at all and offers no setting to enable it. That is an operator's\nprivacy choice: Tor hides a reader's network address, but does not prevent a service from counting\nrequests. The notice says the company would rather not know than be able to.\n\n## Where it goes wrong\n\n**The name is looked up outside Tor.** A program that sends its connections to a SOCKS proxy may\nstill resolve the hostname itself first, through the ordinary resolver, and that lookup tells the\nlocal network and the DNS provider which site is being visited. The connection then travels\nthrough Tor, but the destination has already leaked. In `curl` the difference is a single option:\nwith `--socks5` the name is resolved locally, with `--socks5-hostname` it is handed to the proxy,\nand the exit relay resolves it.\n\n```sh\n# Resolves the name locally, then connects through the proxy\ncurl -s --socks5 127.0.0.1:9050 https://example.org/\n# Hands the name to tor; the exit relay looks it up\ncurl -s --socks5-hostname 127.0.0.1:9050 https://example.org/\n```\n\n**Plain text after the exit.** Tor encrypts the hops between relays, not the last one. The exit\nopens an ordinary TCP connection to the destination and sends what the application gave it, so a\nlogin form submitted over plain HTTP is readable by that exit's operator and by anyone on the\nnetwork beyond it. Serve HTTPS for everything that leaves the Tor network. An onion service\nsidesteps the question because its traffic never leaves.\n\n**One address stands for many readers.** Rate limits and bans keyed on the client address treat an\nexit relay as a single visitor, though many people use it at once. A limit tuned for one person\nlocks out everyone whose circuit happens to end there, and a ban earned by one abuser lands on all\nof them. Decide on purpose how exit addresses are treated instead of letting a generic per-address\nrule decide.\n\n**Identity travels inside the circuit.** Tor hides the network address and does nothing about what\nthe application says. Signing in to a personal account, a distinctive browser setup or a document\nthat fetches something on opening links the session to a person, however many relays sit in\nbetween. The project's own documentation notes that application traffic still needs scrubbing on\nthe user's side, which is the job Tor Browser takes on and an ordinary browser pointed at the\nproxy does not.\n\n**An exit relay on a home connection.** Guard and middle relays rarely draw abuse complaints. The\nexit is where destinations see traffic coming from, so complaints and the occasional legal enquiry\ngo to whoever runs it, and the Tor Project's relay guide says not to run one from home. A\nvolunteer with a single home address can run a bridge instead, an unlisted relay that the same\nguide recommends for that situation.\n\n**Expecting UDP to work.** Voice calls, many games and tools that send their own DNS lookups rely on\nUDP, and Tor carries only TCP streams. Those programs do not work through it, and one that is not\nforced through the proxy may simply connect directly, outside Tor, without saying so.\n\n## Further reading\n\n- [Tor Specifications](https://spec.torproject.org/) — the protocol, path selection, directory and\n  onion service specifications in one place.\n- [Tor: The Second-Generation Onion Router](https://svn-archive.torproject.org/svn/projects/design-paper/tor-design.pdf)\n  — the design paper: circuits, cells, exit policies, and an explicit list of what the design does\n  not attempt.\n- [Tor Path Specification](https://spec.torproject.org/path-spec/) — how a client chooses its\n  guard, middle and exit, and which relays may not share a path.\n- [Types of relays on the Tor network](https://community.torproject.org/relay/types-of-relays/) —\n  guard, middle, exit and bridge relays, with the legal exposure each one carries for its\n  operator.\n- [HTTPS encryption and Tor](https://support.torproject.org/about-tor/security/https-encryption-and-tor/)\n  — an interactive view of what an eavesdropper sees with Tor, with HTTPS, with both and with\n  neither.\n\n\u003chttps://engineer.company/glossary/tor/\u003e\n","date_modified":"2026-11-12T05:34:23Z","description":"Tor for website operators: how a circuit of relays hides a reader's address, what the design does not promise, and how to treat readers who arrive over it.","formats":{"gemtext":"https://engineer.company/glossary/tor/index.gmi","gopher":"https://engineer.company/glossary/tor/gophermap","html":"https://engineer.company/glossary/tor/","json":"https://engineer.company/glossary/tor/index.json","markdown":"https://engineer.company/glossary/tor/index.md","pdf":"https://engineer.company/glossary/tor/index.pdf"},"kind":"page","language":"en","title":"What is Tor?","url":"https://engineer.company/glossary/tor/","version":1}