destination

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDestinationWithConfig

func NewDestinationWithConfig(conf *Config) (stream.Handler, error)

Types

type Config

type Config struct {
	Destinations []*Route
	NotFound     stream.Handler
}

type Destination

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

Destination is an host multiplexer.

func NewDestination

func NewDestination() *Destination

func (*Destination) Handle

func (d *Destination) Handle(ports []uint32, cidr *net.IPNet, handler stream.Handler)

func (*Destination) Handler

func (d *Destination) Handler(ip net.IP, port uint32) (handler stream.Handler)

Handler returns route handler.

func (*Destination) NotFound

func (d *Destination) NotFound(handler stream.Handler)

func (*Destination) ServeStream

func (d *Destination) ServeStream(ctx context.Context, stm stream.Stream)

type Route

type Route struct {
	Ports   []uint32 `json:",omitempty"`
	CIDR    string   `json:",omitempty"`
	Handler stream.Handler
}

Jump to

Keyboard shortcuts

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