portforward

package
v0.68.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager() *Manager

NewManager creates a new port forwarding manager.

func (*Manager) GetMapping

func (m *Manager) GetMapping() *Mapping

GetMapping returns the current mapping if ready, nil otherwise

func (*Manager) GracefullyStop

func (m *Manager) GracefullyStop(ctx context.Context) error

GracefullyStop cancels the manager and attempts to delete the port mapping. After GracefullyStop returns, the manager cannot be restarted.

func (*Manager) Start

func (m *Manager) Start(ctx context.Context, wgPort uint16)

type Mapping

type Mapping struct {
	Protocol     string
	InternalPort uint16
	ExternalPort uint16
	ExternalIP   net.IP
	NATType      string
	// TTL is the lease duration. Zero means a permanent lease that never expires.
	TTL time.Duration
}

Mapping represents an active NAT port mapping.

Jump to

Keyboard shortcuts

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