tor

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2019 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Overview

Package tor provides an interface for controlling and using a tor daemon.

Index

Constants

This section is empty.

Variables

View Source
var ErrTorNotRunning = errors.New("tor not running")

ErrTorNotRunning is the error returned when the tor is not running.

Functions

func CfgToSandboxTorrc

func CfgToSandboxTorrc(cfg *config.Config, bridges map[string][]string) ([]byte, error)

CfgToSandboxTorrc converts the `ui/config/Config` to a sandboxed tor ready torrc.

Types

type Tor

type Tor struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Tor is a tor instance.

func NewSandboxedTor

func NewSandboxedTor(cfg *config.Config, process *process.Process) *Tor

NewSandboxedTor creates a Tor struct around a sandboxed tor instance.

func NewSystemTor

func NewSystemTor(cfg *config.Config) (*Tor, error)

NewSystemTor creates a Tor struct around a system tor instance.

func (*Tor) CtrlSurrogatePath

func (t *Tor) CtrlSurrogatePath() string

CtrlSurrogatePath returns the control port surrogate AF_UNIX path.

func (*Tor) Dialer

func (t *Tor) Dialer() (proxy.Dialer, error)

Dialer returns a proxy.Dialer configured to use the Socks port with the generic `sandboxed-tor-browser:isolation:pid` isolation settings.

func (*Tor) DoBootstrap

func (t *Tor) DoBootstrap(cfg *config.Config, async *Async) (err error)

DoBootstrap will bootstrap a tor instance, if it is one that is lauched by us.

func (*Tor) IsSystem

func (t *Tor) IsSystem() bool

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) SocksPort

func (t *Tor) SocksPort() (net, addr string, err error)

SocksPort returns the SocksPort associated with the tor instance.

func (*Tor) SocksSurrogatePath

func (t *Tor) SocksSurrogatePath() string

SocksSurrogatePath returns the socks port surrogate AF_UNIX path.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL