Documentation
¶
Overview ¶
Package tunnel implements TCP/UDP forwarding over WireGuard.
Index ¶
- Variables
- func Apoxy4To6Range() netip.Prefix
- func CreateKernelTunnel(ctx context.Context, projectID uuid.UUID, endpoint string, ...) (*kernelTunnel, error)
- func CreateUserspaceTunnel(ctx context.Context, projectID uuid.UUID, endpoint string, socksPort uint16, ...) (*userspaceTunnel, error)
- func NewApoxy4To6Prefix(orgID uuid.UUID, endpoint string) netip.Prefix
- type Tunnel
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultSTUNServers = []string{
"stun.l.google.com:19302",
"stun.cloudflare.com:3478",
}
DefaultSTUNServers is a list of default STUN servers to use for determining the external address.
Functions ¶
func Apoxy4To6Range ¶
Apoxy4To6Range returns the Unique Local Adddres prefix used by Apoxy for IPv4 to IPv6 translation.
func CreateKernelTunnel ¶ added in v0.4.1
func CreateKernelTunnel( ctx context.Context, projectID uuid.UUID, endpoint string, stunServers []string, ) (*kernelTunnel, error)
CreateKernelTunnel creates a new kernel tunnel interface (WireGuard).
Types ¶
type Tunnel ¶
type Tunnel interface {
io.Closer
// Peers returns the public keys of the peers in the tunnel.
Peers() ([]wireguard.PeerConfig, error)
// AddPeer adds a new peer to the tunnel.
AddPeer(peerConf *wireguard.PeerConfig) error
// RemovePeer removes a peer from the tunnel.
RemovePeer(publicKey string) error
// PublicKey returns the public key of this end of the tunnel.
PublicKey() string
// ExternalAddress returns the external address of this end of the tunnel.
ExternalAddress() netip.AddrPort
// InternalAddress returns the internal address of this end of the tunnel.
InternalAddress() netip.Prefix
// ListenPort returns the local listen port of this end of the tunnel.
ListenPort() uint16
}
Tunnel is a WireGuard tunnel.
Click to show internal directories.
Click to hide internal directories.