Documentation ¶
Index ¶
- Variables
- func IsTorExit(src net.IP) bool
- func ServiceID(key interface{}) (id string, err error)
- type Onion
- type Service
- func (s *Service) Authenticate(auth string) error
- func (s *Service) Close() error
- func (s *Service) Dial(netw, address string, flags ...string) (net.Conn, error)
- func (s *Service) DialTimeout(netw, address string, timeout time.Duration, flags ...string) (net.Conn, error)
- func (s *Service) GetConf(cfg string) (map[string][]string, error)
- func (s *Service) GetInfo(keys []string) (map[string][]string, error)
- func (s *Service) GetSocksPort(flags ...string) (string, error)
- func (s *Service) MapAddress(addrs map[string]string) (map[string][]string, error)
- func (s *Service) ResetConf(cfg string) error
- func (s *Service) SaveConf(force bool) error
- func (s *Service) SetConf(key, value string) error
- func (s *Service) SetConfList(cfg map[string]string) error
- func (s *Service) SetEvents(evs []string, extended bool) error
- func (s *Service) Signal(sig string) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrOnionAlreadyRunning = errors.New("onion already running") ErrOnionNotRunning = errors.New("onion not running") ErrOnionInvalidKey = errors.New("invalid onion key") ErrOnionInvalidKeyType = errors.New("invalid onion key type") ErrOnionKeyInvalidSize = errors.New("invalid onion key size") ErrOnionKeyExists = errors.New("onion private key already exists") ErrOnionMissingKey = errors.New("missing private key for onion") ErrOnionInvalidKeySpec = errors.New("invalid private key specification") ErrOnionAddFailed = errors.New("failed to add hidden service") ErrOnionServiceID = errors.New("serviceID mismatch") )
Error codes
var ( ErrTorNoSocksPort = errors.New("no SocksPort found") ErrTorNotLocal = errors.New("tor service not local") )
Error codes
var (
ErrTorInvalidProto = fmt.Errorf("only TCP protocol allowed")
)
Error codes
Functions ¶
Types ¶
type Onion ¶
type Onion struct {
// contains filtered or unexported fields
}
Onion is a hidden service implementation on a Tor service
func (*Onion) ServiceID ¶
ServiceID returns the "onion name" of the hidden service (without the trailing ".onion")
func (*Onion) SetCredentials ¶
SetCredentials sets username and password for basic authentication
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service instance to communicate commands (and responses) with a running Tor process.
func NewService ¶
NewService instantiates a new Tor controller
func (*Service) Authenticate ¶
Authenticate client by password defined in torrc as "HashedControlPassword 16:..."
func (*Service) DialTimeout ¶
func (s *Service) DialTimeout(netw, address string, timeout time.Duration, flags ...string) (net.Conn, error)
DialTimeout to establish a Tor-based connection with timeout
func (*Service) GetConf ¶
GetConf returns the configuration settings associated with a config string. Key/value pairs are returned in a map.
func (*Service) GetSocksPort ¶
GetSocksPort returns the best-matching SocksPort definition for a given set of flags (only works for local Tor services)
func (*Service) MapAddress ¶
MapAddress tells the Tor servce that future SOCKS requests for connections to the original address should be replaced with connections to the specified replacement address.
func (*Service) SaveConf ¶
SaveConf instructs the server to write out its config options into its torrc.
func (*Service) SetConfList ¶
SetConfList sets all settings from a list of key/value pairs