portforward

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPersistent added in v0.24.0

func IsPersistent(localPort uint16) bool

IsPersistent checks if a port forward is marked as persistent.

func IsPortForwarded

func IsPortForwarded(localPort uint16) bool

IsPortForwarded checks if a port is already being forwarded

func MarkPersistent added in v0.24.0

func MarkPersistent(localPort uint16)

MarkPersistent marks a port forward as persistent.

func RunTCPForwarderViaAgentWithContext

func RunTCPForwarderViaAgentWithContext(ctx context.Context, proxyServerURL, listen, space string, port int, token string, skipTLSVerify bool) net.Listener

RunTCPForwarderViaAgentWithContext runs a TCP forwarder via the agent proxy server

func StopForward

func StopForward(localPort uint16)

StopForward stops and removes a port forward

func StoreListener

func StoreListener(localPort uint16, listener net.Listener)

StoreListener stores the listener for a port forward (called after listener is created)

func UnmarkPersistent added in v0.24.0

func UnmarkPersistent(localPort uint16)

UnmarkPersistent removes the persistent mark from a port forward.

Types

type ForwardInfo

type ForwardInfo struct {
	LocalPort  uint16
	Space      string
	RemotePort uint16
	Cancel     context.CancelFunc
	Listener   net.Listener
}

ForwardInfo holds information about an active port forward

func GetForward

func GetForward(localPort uint16) (*ForwardInfo, bool)

GetForward returns info about a specific port forward

func ListForwards

func ListForwards() []*ForwardInfo

ListForwards returns all active port forwards

func StartForward

func StartForward(localPort, remotePort uint16, space string, cancel context.CancelFunc) *ForwardInfo

StartForward starts a new port forward and returns the info

Jump to

Keyboard shortcuts

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