torx

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package torx contains code to control tor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogFile added in v0.12.0

func LogFile(sess Session) string

LogFile returns the name of tor logs given a specific session. The file is always located somewhere inside the sess.TempDir() directory.

Types

type Session added in v0.18.0

type Session interface {
	TempDir() string
	TorArgs() []string
	TorBinary() string
}

Session is the way in which this package sees a Session.

type StartConfig

type StartConfig struct {
	Sess          Session
	Start         func(ctx context.Context, conf *tor.StartConf) (*tor.Tor, error)
	EnableNetwork func(ctx context.Context, tor *tor.Tor, wait bool) error
	GetInfo       func(ctrl *control.Conn, keys ...string) ([]*control.KeyVal, error)
}

StartConfig contains the configuration for StartWithConfig

type TorProcess

type TorProcess interface {
	Close() error
}

TorProcess is a running tor process

type Tunnel

type Tunnel struct {
	// contains filtered or unexported fields
}

Tunnel is the Tor tunnel

func Start

func Start(ctx context.Context, sess Session) (*Tunnel, error)

Start starts the tor tunnel

func StartWithConfig

func StartWithConfig(ctx context.Context, config StartConfig) (*Tunnel, error)

StartWithConfig is a configurable Start for testing

func (*Tunnel) BootstrapTime

func (tt *Tunnel) BootstrapTime() (duration time.Duration)

BootstrapTime is the bootstrsap time

func (*Tunnel) SOCKS5ProxyURL

func (tt *Tunnel) SOCKS5ProxyURL() (url *url.URL)

SOCKS5ProxyURL returns the URL of the SOCKS5 proxy

func (*Tunnel) Stop

func (tt *Tunnel) Stop()

Stop stops the Tor tunnel

Jump to

Keyboard shortcuts

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