conn

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProxy added in v0.6.2

func GetProxy(rule constants.Policy) (C.Proxy, error)

func NewTcpConn

func NewTcpConn(ctx context.Context, metadata *C.Metadata, rule ruleEngine.Rule, defaultInterface string) (net.Conn, error)

func NewUdpConn

func NewUdpConn(ctx context.Context, metadata *C.Metadata, rule ruleEngine.Rule, defaultInterface string) (net.PacketConn, error)

func RejectQuicMather added in v0.13.0

func RejectQuicMather(metadata *C.Metadata, prevRule ruleEngine.Rule) (ruleEngine.Rule, error)

func UpdateConnMatcher added in v0.13.0

func UpdateConnMatcher(matchers []Matcher)

func UpdateProxy

func UpdateProxy(remoteProxy C.Proxy)

Types

type Matcher

type Matcher func(metadata *C.Metadata, rule ruleEngine.Rule) (ruleEngine.Rule, error)

func GetConnMatcher added in v0.13.0

func GetConnMatcher() []Matcher

type TcpConnContext

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

func NewTcpConnContext

func NewTcpConnContext(ctx context.Context, conn net.Conn, metadata *C.Metadata, wg *sync.WaitGroup) (*TcpConnContext, error)

func (*TcpConnContext) Conn

func (t *TcpConnContext) Conn() net.Conn

func (*TcpConnContext) Ctx

func (t *TcpConnContext) Ctx() context.Context

func (*TcpConnContext) Metadata

func (t *TcpConnContext) Metadata() *C.Metadata

func (*TcpConnContext) Rule

func (t *TcpConnContext) Rule() ruleEngine.Rule

func (*TcpConnContext) Wg

func (t *TcpConnContext) Wg() *sync.WaitGroup

type UdpConn

type UdpConn interface {
	ReadFrom([]byte) (int, net.Addr, error)
	WriteTo([]byte, net.Addr) (int, error)
	Close() error
	SetDeadline(t time.Time) error
	SetReadDeadline(t time.Time) error
	SetWriteDeadline(t time.Time) error
}

type UdpConnContext

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

func NewUdpConnContext

func NewUdpConnContext(ctx context.Context, conn UdpConn, metadata *C.Metadata, wg *sync.WaitGroup) (*UdpConnContext, error)

func (*UdpConnContext) Conn

func (u *UdpConnContext) Conn() UdpConn

func (*UdpConnContext) Ctx

func (u *UdpConnContext) Ctx() context.Context

func (*UdpConnContext) Metadata

func (u *UdpConnContext) Metadata() *C.Metadata

func (*UdpConnContext) Rule

func (u *UdpConnContext) Rule() ruleEngine.Rule

func (*UdpConnContext) Wg

func (u *UdpConnContext) Wg() *sync.WaitGroup

Jump to

Keyboard shortcuts

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