source

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSourceWithConfig

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

Types

type Config

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

type Route

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

type Source

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

Source is an host multiplexer.

func NewSource

func NewSource() *Source

func (*Source) Handle

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

func (*Source) Handler

func (s *Source) Handler(ip net.IP, port uint32) (handler stream.Handler)

Handler returns route handler.

func (*Source) NotFound

func (s *Source) NotFound(handler stream.Handler)

func (*Source) ServeStream

func (s *Source) ServeStream(ctx context.Context, stm stream.Stream)

Jump to

Keyboard shortcuts

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