tunnel

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package tunnel implements TCP/UDP forwarding over WireGuard.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apoxy4To6Range

func Apoxy4To6Range() netip.Prefix

Apoxy4To6Range returns the Unique Local Adddres prefix used by Apoxy for IPv4 to IPv6 translation.

func NewApoxy4To6Prefix

func NewApoxy4To6Prefix(orgID uuid.UUID, endpoint string) netip.Prefix

NewApoxy4To6Prefix generates a new IPv6 address from the Apoxy4To6Range prefix.

Types

type Tunnel

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

func CreateTunnel

func CreateTunnel(
	ctx context.Context,
	projectID uuid.UUID,
	endpoint string,
	socksPort uint16,
	verbose bool,
) (*Tunnel, error)

CreateTunnel creates a new user-space WireGuard tunnel.

func (*Tunnel) AddPeer

func (t *Tunnel) AddPeer(peerConf *wireguard.PeerConfig) error

func (*Tunnel) Close

func (t *Tunnel) Close()

func (*Tunnel) ExternalAddress

func (t *Tunnel) ExternalAddress() netip.AddrPort

func (*Tunnel) InternalAddress

func (t *Tunnel) InternalAddress() netip.Prefix

func (*Tunnel) ProxyAddress

func (t *Tunnel) ProxyAddress() string

func (*Tunnel) PublicKey

func (t *Tunnel) PublicKey() string

func (*Tunnel) RemovePeer

func (t *Tunnel) RemovePeer(publicKey string) error

Jump to

Keyboard shortcuts

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