source

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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