router

package
v0.0.0-...-3139442 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCIDRRule

func NewCIDRRule(cidrs []string) *cidrRule

func NewDomainRule

func NewDomainRule(domains []string) *domainRule

func NewRouter

func NewRouter(conf string, resolver dns.Resolver, outbounds map[string]outbound.Outbound) (*router, error)

Types

type Router

type Router interface {
	DialTcp(targetAddr string) (conn net.Conn, err error, outName, realAddr string)
	HandleTcpStream(protocolName string, conn net.Conn, clientAddr, targetAddr string)
	SendUdpPacket(protocolName string, clientAddr, targetAddr string, data []byte, receiver UdpPacketReceiver)
}

type Rule

type Rule interface {
	NeedsIP() bool
	Matches(host string, ip netip.Addr) bool
}

type UdpPacketReceiver

type UdpPacketReceiver func(remoteAddr net.Addr, data []byte)

Jump to

Keyboard shortcuts

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