tor

package
v0.58.13 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: Unlicense Imports: 4 Imported by: 0

Documentation

Overview

Package tor provides a Tor hidden service transport for the relay. It wraps the existing pkg/tor service as a pluggable transport.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Port is the internal port for the hidden service.
	Port int
	// DataDir is the directory for Tor data (torrc, keys, hostname, etc.).
	DataDir string
	// Binary is the path to the tor executable.
	Binary string
	// SOCKSPort is the port for outbound SOCKS connections (0 = disabled).
	SOCKSPort int
	// Handler is the HTTP handler to serve.
	Handler http.Handler
}

Config holds Tor transport configuration.

type Transport

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

Transport serves the relay as a Tor hidden service.

func New

func New(cfg *Config) *Transport

New creates a new Tor transport.

func (*Transport) Addresses

func (t *Transport) Addresses() []string

func (*Transport) Name

func (t *Transport) Name() string

func (*Transport) Service

func (t *Transport) Service() *torservice.Service

Service returns the underlying Tor service for access to Tor-specific functionality (e.g., OnionAddress, DataDir).

func (*Transport) Start

func (t *Transport) Start(ctx context.Context) error

func (*Transport) Stop

func (t *Transport) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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