conn

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIsProxyAddr added in v0.2.6

func GetIsProxyAddr(addr string) bool

func GetProxyAddr added in v0.2.6

func GetProxyAddr() string

func NewTcpConn

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

func NewUdpConn

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

func UpdateMatcher added in v0.2.0

func UpdateMatcher(c Matcher)

func UpdateProxy

func UpdateProxy(remoteProxy C.Proxy)

Types

type Matcher added in v0.2.0

type Matcher interface {
	GetRule(ip string) constants.IpRule
}

func GetMatcher added in v0.2.0

func GetMatcher() Matcher

type ProxyAddr added in v0.2.0

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

func (ProxyAddr) Addr added in v0.2.0

func (p ProxyAddr) Addr() string

func (ProxyAddr) Type added in v0.2.0

func (p ProxyAddr) Type() ProxyAddrType

type ProxyAddrType added in v0.2.0

type ProxyAddrType int
const (
	ProxyAddrDomain ProxyAddrType = 0
	ProxyAddrIp     ProxyAddrType = 1
)

type TcpConnContext

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

func NewTcpConnContext

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

func (*TcpConnContext) Conn

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

func (*TcpConnContext) Ctx

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

func (*TcpConnContext) ID

func (t *TcpConnContext) ID() uuid.UUID

func (*TcpConnContext) Metadata

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

func (*TcpConnContext) Rule

func (t *TcpConnContext) Rule() constants.IpRule

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
}

type UdpConnContext

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

func NewUdpConnContext

func NewUdpConnContext(ctx context.Context, conn UdpConn, metadata *constant.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) ID

func (u *UdpConnContext) ID() uuid.UUID

func (*UdpConnContext) Metadata

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

func (*UdpConnContext) Rule

func (u *UdpConnContext) Rule() constants.IpRule

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