Documentation ¶
Overview ¶
Package wg implements a WireGuard tunnel device and TCP/UDP forwarding.
Index ¶
- func Apoxy4To6Range() netip.Prefix
- func NewApoxy4To6Prefix(orgID uuid.UUID, endpoint string) netip.Prefix
- func TrySTUN(srcPort int, addrs ...string) (net.IP, []int, error)
- type Tunnel
- func (t *Tunnel) AddPeer(pubKeyHex string, endpoint netip.AddrPort, allowedIPs []net.IPNet, ...) error
- func (t *Tunnel) Close()
- func (t *Tunnel) ExternalAddress() netip.AddrPort
- func (t *Tunnel) InternalAddress() netip.Prefix
- func (t *Tunnel) PubKey() wgtypes.Key
- func (t *Tunnel) RemovePeer(pubKeyHex string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apoxy4To6Range ¶
Apoxy4To6Range returns the Unique Local Adddres prefix used by Apoxy for IPv4 to IPv6 translation.
func NewApoxy4To6Prefix ¶
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, verbose bool, ) (*Tunnel, error)
CreateTunnel creates a new WireGuard device (userspace).
func (*Tunnel) ExternalAddress ¶
func (*Tunnel) InternalAddress ¶
func (*Tunnel) RemovePeer ¶
Click to show internal directories.
Click to hide internal directories.