lup

package module
v0.0.0-...-1852be0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2022 License: MIT Imports: 11 Imported by: 0

README

listenup(NP)

Go library to listen and forward on a port in a single step, with the same interface as net.Listen.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(proto, addr string) (net.Listener, error)

Types

type RouterClient

type RouterClient interface {
	AddPortMapping(
		NewRemoteHost string,
		NewExternalPort uint16,
		NewProtocol string,
		NewInternalPort uint16,
		NewInternalClient string,
		NewEnabled bool,
		NewPortMappingDescription string,
		NewLeaseDuration uint32,
	) (err error)

	GetExternalIPAddress() (
		NewExternalIPAddress string,
		err error,
	)
}

type UpListener

type UpListener struct {
	net.Listener
	// contains filtered or unexported fields
}

func NewUpListener

func NewUpListener(ctx context.Context) *UpListener

func (*UpListener) Accept

func (upl *UpListener) Accept() (net.Conn, error)

func (*UpListener) Addr

func (upl *UpListener) Addr() net.Addr

func (*UpListener) GetIPAndForwardPort

func (upl *UpListener) GetIPAndForwardPort() error

func (*UpListener) GetInternalIPAddress

func (upl *UpListener) GetInternalIPAddress() (string, error)

func (*UpListener) Listen

func (upl *UpListener) Listen(proto, addr string) (net.Listener, error)

func (*UpListener) Name

func (upl *UpListener) Name() string

func (*UpListener) PickRouterClient

func (upl *UpListener) PickRouterClient() (RouterClient, error)

func (*UpListener) Poke

func (upl *UpListener) Poke(proto, addr string) error

func (*UpListener) UPnPLoop

func (upl *UpListener) UPnPLoop(cancel context.CancelFunc)

Jump to

Keyboard shortcuts

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