Safe Haskell | None |
---|---|
Language | Haskell2010 |
Various options for running a Tor node
- data TorOptions = TorOptions {}
- defaultTorOptions :: TorOptions
- data TorEntranceOptions = TorEntranceOptions {}
- defaultTorEntranceOptions :: TorEntranceOptions
- data TorRelayOptions = TorRelayOptions {}
- defaultTorRelayOptions :: TorRelayOptions
- data TorExitOptions = TorExitOptions {}
- defaultTorExitOptions :: TorExitOptions
- data ExitRule
- data AddrSpec
- data PortSpec
- makeLogger :: (String -> IO ()) -> String -> IO ()
Options for running Tor
data TorOptions Source
How the node should be set up during initialization. For each of these
items, Nothing
means that the node will not operate in that capacity, while
Just of the option type will initialize that system with those options.
Note that while we will do our best to make it work, it doesn't make a whole lot of sense to be an Exit node and not be a Relay node.
defaultTorOptions :: TorOptions Source
A reasonable default set of options for a Tor node. Sets the node up as an entrance and relay node with their standard options, and logging output printed to stdout.
data TorEntranceOptions Source
Options for allowing circuits that originated at this node.
TorEntranceOptions | |
|
defaultTorEntranceOptions :: TorEntranceOptions Source
A reasonable set of entrance options. The internal circuit length is set to 4, and a target number of links of 5.
data TorRelayOptions Source
Options for allowing circuits that pass through this node.
TorRelayOptions | |
|
defaultTorRelayOptions :: TorRelayOptions Source
A reasonable set of relay options. The onion port is set to 9374, the nickname is set to "", and no contact information is provided. These options set the maximum number of links to 50.
data TorExitOptions Source
Options for allowing circuits that end at this node.
TorExitOptions | |
|
defaultTorExitOptions :: TorExitOptions Source
A reasonable default exit node options. This allows all outgoing traffic to ports 22 (SSH), 80 (HTTP), 443 (HTTPS), 465 (SMTPS), and 993 (IMAPS), and disallows single hop exits.
A rule for accepting or rejecting traffic, usually specified by exit nodes.
ExitRuleAccept AddrSpec PortSpec | Accept matching traffic. |
ExitRuleReject AddrSpec PortSpec | Reject matching traffic. |
An address or subnet specifier.
AddrSpecAll | Accept any address |
AddrSpecIP4 String | Accept this specific address. |
AddrSpecIP4Mask String String | Accept this IP address and subnet mask (255.255.255.0,etc.) |
AddrSpecIP4Bits String Int | Accept this IP address and CIDR mask (/24,etc.) |
AddrSpecIP6 String | Accept this specific IP6 address. |
AddrSpecIP6Bits String Int | Accept this subnet and CIDR mask. |
A port specifier
PortSpecAll | Accept any port |
PortSpecRange Word16 Word16 | Accept ports between the two values, inclusive. |
PortSpecSingle Word16 | Accept only the given port. |
Handy utilities
makeLogger :: (String -> IO ()) -> String -> IO () Source
If you like the output format of the default log function, but want to send it to your own output stream, this is the function for you! This function takes an outgoing logger and a string to log, and adds a nicely- formatted and easily-sortable timestamp to the front of it.
NOTE: The default value for the logger is (makeLogger putStrLn).