tor

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package tor fetches URLs and wraps commands so they egress through the host's Tor SOCKS proxy. tor-url fetches run on the host (constrained); generic and IRC commands run inside the member's pod via torsocks (see cmd/agentbbs).

Index

Constants

This section is empty.

Variables

View Source
var SocksAddr = envOr("AGENTBBS_TOR_SOCKS", "127.0.0.1:9050")

SocksAddr is the host-local Tor SOCKS5 endpoint that setup.sh's tor service listens on. Overridable so a dev host can point elsewhere.

Functions

func FetchURL

func FetchURL(ctx context.Context, rawURL string) ([]byte, error)

FetchURL retrieves rawURL over Tor and returns the body (capped at maxBytes). Only http/https are allowed and the call is bounded by a timeout, so the URL (passed to curl as a single argv element — never a shell) can't be abused to reach the local network or run unboundedly.

func IRCArgv

func IRCArgv(server string) []string

IRCArgv builds the argv for an interactive IRC-over-Tor session to server (host[:port]); it runs irssi through torsocks. server is validated by the caller. Defaults to the standard IRC port when none is given.

func Torsocks

func Torsocks(argv []string) []string

Torsocks prefixes argv with torsocks so the command's network traffic is routed through Tor when run inside a pod that has torsocks configured.

Types

This section is empty.

Jump to

Keyboard shortcuts

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