filter

package
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyConn

func VerifyConn(filter Filter, remote net.Addr) bool

Types

type DialFunc

type DialFunc struct {
	network.DialFunc
	Whitelist []Match
	Blacklist []Match
}

func (*DialFunc) Dial

func (df *DialFunc) Dial(network, address string) (conn net.Conn, err error)

func (*DialFunc) GetBlacklist

func (df *DialFunc) GetBlacklist() []Match

func (*DialFunc) GetWhitelist

func (df *DialFunc) GetWhitelist() []Match

type Filter

type Filter interface {
	GetBlacklist() []Match
	GetWhitelist() []Match
}

type Listener

type Listener struct {
	net.Listener
	Whitelist []Match
	Blacklist []Match
}

func (*Listener) Accept

func (l *Listener) Accept() (conn net.Conn, err error)

func (*Listener) GetBlacklist

func (l *Listener) GetBlacklist() []Match

func (*Listener) GetWhitelist

func (l *Listener) GetWhitelist() []Match

type Match

type Match struct {
	Host      *regexp.Regexp
	Port      int
	PortRange [2]int
}

func (*Match) Match

func (m *Match) Match(addr net.Addr) bool

Jump to

Keyboard shortcuts

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