tor

package
v0.0.0-...-72cce0b Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	SocksPort, ControlPort int
	DataDir, Binary, TorRC string
	ControlPass            bool
	StdOut, StdErr         io.Writer
}

Conf is used to pass config values to create a Tor Instance.

func DefaultConf

func DefaultConf() Conf

type Instance

type Instance struct {
	Proxy  proxy.Dialer
	Config Conf
	Stop   context.CancelFunc
	// contains filtered or unexported fields
}

Instance represents an instance of a Tor process. It can be stopped using the Stop() CancelFunc.

func NewInstance

func NewInstance(ctx context.Context, conf Conf) (*Instance, error)

NewInstance creates a Instance of a running to process.

func (*Instance) BinaryPath

func (i *Instance) BinaryPath() string

func (*Instance) DeregisterService

func (i *Instance) DeregisterService(pub ed25519.PublicKey) error

DeregisterService removes a HiddenService.

func (*Instance) Log

func (i *Instance) Log() string

Log returns the output of STDOUT and STDERR from the Tor process.

func (*Instance) Pid

func (i *Instance) Pid() int

func (*Instance) RegisterService

func (i *Instance) RegisterService(priv ed25519.PrivateKey, torPort, localPort int) error

RegisterService registers a new V3 Hidden Service, and proxies the requests to the specified local port.

func (*Instance) Version

func (i *Instance) Version() string

Jump to

Keyboard shortcuts

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