network

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InternalNetwork = "exitbox-int"
	EgressNetwork   = "exitbox-egress"
	SquidContainer  = "exitbox-squid"
)

Variables

This section is empty.

Functions

func AddSessionURLAndReload added in v0.1.3

func AddSessionURLAndReload(rt container.Runtime, containerName string, domain string) error

AddSessionURLAndReload adds a domain to a container's session URLs and hot-reloads Squid so the change takes effect immediately.

func CleanupSquidIfUnused

func CleanupSquidIfUnused(rt container.Runtime)

CleanupSquidIfUnused stops squid if no agent containers are running.

func EnsureNetworks

func EnsureNetworks(rt container.Runtime)

EnsureNetworks creates the shared networks if they don't exist.

func GenerateSquidConfig

func GenerateSquidConfig(subnet string, domains []string, extraURLs []string) string

GenerateSquidConfig generates the squid.conf content.

func GetNetworkSubnet

func GetNetworkSubnet(rt container.Runtime, networkName string) (string, error)

GetNetworkSubnet returns the subnet for a network.

func GetProxyEnvVars

func GetProxyEnvVars(rt container.Runtime) []string

GetProxyEnvVars returns proxy environment variable flags for container run.

func NormalizeAllowlistEntry

func NormalizeAllowlistEntry(value string) (string, error)

NormalizeAllowlistEntry normalizes a domain for Squid dstdomain ACL. Ported from lib/network.sh:normalize_allowlist_entry.

func RegisterSessionURLs added in v0.1.1

func RegisterSessionURLs(containerName string, urls []string) error

RegisterSessionURLs writes a session file for a container's extra URLs.

func RemoveSessionURLs added in v0.1.1

func RemoveSessionURLs(rt container.Runtime, containerName string)

RemoveSessionURLs removes a container's session file and regenerates squid config.

func StartSquidProxy

func StartSquidProxy(rt container.Runtime, containerName string, extraURLs []string) error

StartSquidProxy starts the Squid proxy container.

Types

This section is empty.

Jump to

Keyboard shortcuts

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