haskell-tor-0.1.1: A Haskell Tor Node

Safe HaskellNone
LanguageHaskell2010

Tor.State.CircuitManager

Description

This module provides a high-level interface for building, closing, and managing open circuits within the Tor network.

Synopsis

Documentation

data HasBackend s => CircuitManager ls s Source

A handle for the circuit manager component, to be passed amongst functions in this module.

newCircuitManager :: HasBackend s => TorOptions -> TorNetworkStack ls s -> Credentials -> RouterDB -> LinkManager ls s -> IO (CircuitManager ls s) Source

Create a new circuit manager given the previously-initialized components. Using a circuit manager will allow you to more easily reuse circuits across multiple connections, decreasing the overhead of using Tor. In additionally, eventually you will be able to track and gather statistics on circuit history over time by using this component.

openCircuit :: HasBackend s => CircuitManager ls s -> [RouterRestriction] -> IO OriginatedCircuit Source

Open a circuit to an exit node that allows connections according to the given restrictions.

closeCircuit :: HasBackend s => CircuitManager ls s -> OriginatedCircuit -> IO () Source

Close a circuit. DO NOT CALL THIS. Instead, just drop all references to the structure; we'll worry about this later.