Simplify the math to round up to the next multiple of some value.
[tor/rransom.git] / doc / spec / address-spec.txt
blob95641b49b8ee51e297bb62a9bf6277855333fb60
2                           Special Hostnames in Tor
3                                Nick Mathewson
5 1. Overview
7   Most of the time, Tor treats user-specified hostnames as opaque:  When
8   the user connects to www.torproject.org, Tor picks an exit node and uses
9   that node to connect to "www.torproject.org".  Some hostnames, however,
10   can be used to override Tor's default behavior and circuit-building
11   rules.
13   These hostnames can be passed to Tor as the address part of a SOCKS4a or
14   SOCKS5 request.  If the application is connected to Tor using an IP-only
15   method (such as SOCKS4, TransPort, or NatdPort), these hostnames can be
16   substituted for certain IP addresses using the MapAddress configuration
17   option or the MAPADDRESS control command.
19 2. .exit
21   SYNTAX:  [hostname].[name-or-digest].exit
22            [name-or-digest].exit
24   Hostname is a valid hostname; [name-or-digest] is either the nickname of a
25   Tor node or the hex-encoded digest of that node's public key.
27   When Tor sees an address in this format, it uses the specified hostname as
28   the exit node.  If no "hostname" component is given, Tor defaults to the
29   published IPv4 address of the exit node.
31   It is valid to try to resolve hostnames, and in fact upon success Tor
32   will cache an internal mapaddress of the form
33   "www.google.com.foo.exit=64.233.161.99.foo.exit" to speed subsequent
34   lookups.
36   EXAMPLES:
37      www.example.com.exampletornode.exit
39         Connect to www.example.com from the node called "exampletornode."
41      exampletornode.exit
43         Connect to the published IP address of "exampletornode" using
44         "exampletornode" as the exit.
46 3. .onion
48   SYNTAX:  [digest].onion
50   The digest is the first eighty bits of a SHA1 hash of the identity key for
51   a hidden service, encoded in base32.
53   When Tor sees an address in this format, it tries to look up and connect to
54   the specified hidden service.  See rend-spec.txt for full details.
56 4. .noconnect
58   SYNTAX:  [string].noconnect
60   When Tor sees an address in this format, it immediately closes the
61   connection without attaching it to any circuit.  This is useful for
62   controllers that want to test whether a given application is indeed using
63   the same instance of Tor that they're controlling.
65 5. [XXX Is there a ".virtual" address that we expose too, or is that
66 just intended to be internal? -RD]