Documentation ¶
Overview ¶
Package tor provides an interface for controlling and using a tor daemon.
Index ¶
- Variables
- func CfgToSandboxTorrc(cfg *config.Config, bridges map[string][]string) ([]byte, error)
- type Tor
- func (t *Tor) CtrlSurrogatePath() string
- func (t *Tor) Dialer() (proxy.Dialer, error)
- func (t *Tor) DoBootstrap(cfg *config.Config, async *Async) (err error)
- func (t *Tor) IsSystem() bool
- func (t *Tor) Shutdown()
- func (t *Tor) SocksPort() (net, addr string, err error)
- func (t *Tor) SocksSurrogatePath() string
Constants ¶
This section is empty.
Variables ¶
var ErrTorNotRunning = errors.New("tor not running")
ErrTorNotRunning is the error returned when the tor is not running.
Functions ¶
Types ¶
type Tor ¶
Tor is a tor instance.
func NewSandboxedTor ¶
NewSandboxedTor creates a Tor struct around a sandboxed tor instance.
func NewSystemTor ¶
NewSystemTor creates a Tor struct around a system tor instance.
func (*Tor) CtrlSurrogatePath ¶
CtrlSurrogatePath returns the control port surrogate AF_UNIX path.
func (*Tor) Dialer ¶
Dialer returns a proxy.Dialer configured to use the Socks port with the generic `sandboxed-tor-browser:isolation:pid` isolation settings.
func (*Tor) DoBootstrap ¶
DoBootstrap will bootstrap a tor instance, if it is one that is lauched by us.
func (*Tor) IsSystem ¶
IsSystem returns if the tor instance is a OS service not being actively managed by the app.
func (*Tor) Shutdown ¶
func (t *Tor) Shutdown()
Shutdown attempts to gracefully clean up the Tor instance. If it is a system tor, only the control port connection will be closed. Otherwise, the tor daemon will be terminated, gracefully if possible.
func (*Tor) SocksSurrogatePath ¶
SocksSurrogatePath returns the socks port surrogate AF_UNIX path.