Safe Haskell | None |
---|---|
Language | Haskell2010 |
Protocol description
Defines functions that handle the advancing of the Tor control protocol.
Warning: This function is used internally by Tor
and using these functions directly is unsupported. The
interface of these functions might change at any time without
prior notice.
- detectPort :: MonadIO m => [Integer] -> m [Integer]
- socksPort :: MonadIO m => Socket -> m Integer
- connect :: MonadIO m => Integer -> SocksAddress -> (Socket -> IO a) -> m a
- connect' :: MonadIO m => Socket -> SocksAddress -> (Socket -> IO a) -> m a
- protocolInfo :: MonadIO m => Socket -> m ProtocolInfo
- authenticate :: MonadIO m => Socket -> m ()
- mapOnion :: MonadIO m => Socket -> Integer -> Integer -> m Base32String
Documentation
:: MonadIO m | |
=> [Integer] | The ports we wish to probe |
-> m [Integer] | The ports which respond like a Tor service |
Probes several default ports to see if there is a service at the remote that behaves like the Tor controller daemon. Will return a list of all the probed ports that have a Tor service, since in some scenarios there will be multiple Tor services (specifically, when a user has both the Tor browser bundle and a separate Tor relay running).
:: MonadIO m | |
=> Integer | Port our tor SOCKS server listens at. |
-> SocksAddress | Address we wish to connect to |
-> (Socket -> IO a) | Computation to execute once connection has been establised |
-> m a |
Connect through a remote using the Tor SOCKS proxy. The remote might me a a normal host/ip or a hidden service address. When you provide a FQDN to resolve, it will be resolved by the Tor service, and as such is secure.
This function is provided as a convenience, since it doesn't actually use the Tor control protocol, and can be used to talk with any Socks5 compatible proxy server.
:: MonadIO m | |
=> Socket | Our connection with the Tor control port |
-> SocksAddress | Address we wish to connect to |
-> (Socket -> IO a) | Computation to execute once connection has been establised |
-> m a |
protocolInfo :: MonadIO m => Socket -> m ProtocolInfo Source
Requests protocol version information from Tor. This can be used while still unauthenticated and authentication methods can be derived from this information.
authenticate :: MonadIO m => Socket -> m () Source
Authenticates with the Tor control server, based on the authentication information returned by PROTOCOLINFO.
:: MonadIO m | |
=> Socket | Connection with tor Control port |
-> Integer | Remote point of hidden service to listen at |
-> Integer | Local port to map onion service to |
-> m Base32String | The address/service id of the Onion without the .onion aprt |
Creates a new hidden service and maps a public port to a local port. Useful for bridging a local service (e.g. a webserver or irc daemon) as a Tor hidden service.