tor

package
v0.0.0-...-90a95e1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	*bulb.OnionInfo
	Port uint16
}

Addr - TOR hidden service address.

func (*Addr) Network

func (addr *Addr) Network() string

Network - Always returns "tcp".

func (*Addr) String

func (addr *Addr) String() string

String - Returns tor onion domain with a port.

type Layer

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

Layer - TOR Layer.

func NewLayer

func NewLayer(opts ...Option) (layer *Layer)

NewLayer - Creates a new TOR layer.

func (*Layer) Close

func (layer *Layer) Close() error

Close - Closes a TOR

func (*Layer) Conn

func (layer *Layer) Conn(conn net.Conn) (net.Conn, error)

Conn - Returns back the same connection. TOR can't wrap an existing connection.

func (*Layer) Dial

func (layer *Layer) Dial(addr string, timeout time.Duration) (net.Conn, error)

Dial - Dials through a TOR proxy.

func (*Layer) IsDialer

func (layer *Layer) IsDialer() bool

IsDialer - Returns true, You can Dial through a TOR proxy.

func (*Layer) Listener

func (layer *Layer) Listener(l net.Listener) (net.Listener, error)

Listener returns a net.Listener backed by a Onion Service, optionally having Tor generate an ephemeral private key. Regardless of the status of the returned Listener, the Onion Service will be torn down when the control connection is closed.

WARNING: Only one port can be listened to per PrivateKey if this interface is used. To bind to more ports, use the AddOnion call directly.

func (*Layer) Name

func (layer *Layer) Name() string

Name - Returns "tor".

type Option

type Option func(*Layer)

Option - TOR layer option.

func WithBin

func WithBin(bin string) Option

WithBin - Sets tor binary path.

func WithBinaryBody

func WithBinaryBody(bin []byte) Option

WithBinaryBody - Sets tor binary body.

func WithClient

func WithClient(client *torctl.Client) Option

WithClient - Sets tor client.

func WithControl

func WithControl(control *bulb.Conn) Option

WithControl - Sets tor client.

func WithKey

func WithKey(key crypto.PrivateKey) Option

WithKey - Sets tor hidden service private key.

func WithPort

func WithPort(port uint16) Option

WithPort - Sets tor listener port.

func WithProxy

func WithProxy(proxy string) Option

WithProxy - Sets tor listener proxy address.

func WithVerbose

func WithVerbose(verbose bool) Option

WithVerbose - Sets tor verbose.

Jump to

Keyboard shortcuts

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