Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateFrontHeadroom(writer any) int
- func CalculateMTU(reader any, writer any) int
- func CalculateRearHeadroom(writer any) int
- func DialParallel(ctx context.Context, dialer Dialer, network string, destination M.Socksaddr, ...) (net.Conn, error)
- func DialSerial(ctx context.Context, dialer Dialer, network string, destination M.Socksaddr, ...) (net.Conn, error)
- func HandshakeFailure(conn any, err error) error
- func IsPublicAddr(addr netip.Addr) bool
- func IsUnsafeWriter(writer any) bool
- func IsVirtual(addr netip.Addr) bool
- func ListenSerial(ctx context.Context, dialer Dialer, destination M.Socksaddr, ...) (net.PacketConn, netip.Addr, error)
- func LocalAddrs() ([]netip.Addr, error)
- func LocalPublicAddrs() ([]netip.Addr, error)
- func NetworkName(network string) string
- func UnwrapReader(reader io.Reader) io.Reader
- func UnwrapWriter(writer io.Writer) io.Writer
- type BindPacketConn
- type CachedPacketReader
- type CachedReader
- type DefaultDialer
- func (d *DefaultDialer) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)
- func (d *DefaultDialer) DialParallel(ctx context.Context, network string, destination M.Socksaddr, ...) (net.Conn, error)
- func (d *DefaultDialer) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)
- type Dialer
- type EarlyConn
- type ExtendedConn
- type ExtendedReader
- type ExtendedWriter
- type FrontHeadroom
- type HandshakeConn
- type LazyHeadroom
- type NetPacketConn
- type NetPacketReader
- type NetPacketWriter
- type PacketConn
- type PacketReader
- type PacketWriter
- type ParallelDialer
- type PayloadDialer
- type ReaderWithMTU
- type ReaderWithUpstream
- type RearHeadroom
- type TCPConnectionHandler
- type ThreadSafePacketReader
- type ThreadSafeReader
- type ThreadUnsafeWriter
- type TimeoutPacketReader
- type UDPConnectionHandler
- type UDPHandler
- type VectorisedPacketWriter
- type VectorisedWriter
- type WithUpstreamReader
- type WithUpstreamWriter
- type WriterWithMTU
- type WriterWithUpstream
Constants ¶
View Source
const ( NetworkIP = "ip" NetworkTCP = "tcp" NetworkUDP = "udp" NetworkICMPv4 = "icmpv4" NetworkICMPv6 = "icmpv6" )
View Source
const DefaultFallbackDelay = 300 * time.Millisecond
View Source
const DefaultHeadroom = 1024
Variables ¶
View Source
var ErrUnknownNetwork = E.New("unknown network")
Functions ¶
func CalculateFrontHeadroom ¶
func CalculateMTU ¶
func CalculateRearHeadroom ¶
func DialParallel ¶
func DialSerial ¶
func HandshakeFailure ¶
func IsPublicAddr ¶
func IsUnsafeWriter ¶
func ListenSerial ¶
func LocalAddrs ¶
func LocalPublicAddrs ¶
func NetworkName ¶
Types ¶
type BindPacketConn ¶
type BindPacketConn interface { NetPacketConn net.Conn }
type CachedPacketReader ¶
type CachedReader ¶
type DefaultDialer ¶
type DefaultDialer struct { net.Dialer net.ListenConfig }
func (*DefaultDialer) DialContext ¶
func (*DefaultDialer) DialParallel ¶
func (*DefaultDialer) ListenPacket ¶
func (d *DefaultDialer) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)
type ExtendedConn ¶
type ExtendedConn interface { ExtendedReader ExtendedWriter net.Conn }
type ExtendedReader ¶
type ExtendedWriter ¶
type FrontHeadroom ¶
type FrontHeadroom interface {
FrontHeadroom() int
}
type HandshakeConn ¶
type LazyHeadroom ¶
type LazyHeadroom interface {
LazyHeadroom() bool
}
type NetPacketConn ¶
type NetPacketConn interface { PacketConn NetPacketReader NetPacketWriter }
type NetPacketReader ¶
type NetPacketWriter ¶
type PacketConn ¶
type PacketReader ¶
func UnwrapPacketReader ¶
func UnwrapPacketReader(reader PacketReader) PacketReader
type PacketWriter ¶
func UnwrapPacketWriter ¶
func UnwrapPacketWriter(writer PacketWriter) PacketWriter
type ParallelDialer ¶
type ParallelDialer interface { Dialer DialParallel(ctx context.Context, network string, destination M.Socksaddr, destinationAddresses []netip.Addr) (net.Conn, error) }
var SystemDialer ParallelDialer = &DefaultDialer{}
type PayloadDialer ¶
type ReaderWithMTU ¶
type ReaderWithMTU interface {
ReaderMTU() int
}
type ReaderWithUpstream ¶
type ReaderWithUpstream interface {
ReaderReplaceable() bool
}
type RearHeadroom ¶
type RearHeadroom interface {
RearHeadroom() int
}
type TCPConnectionHandler ¶
type ThreadSafePacketReader ¶
type ThreadSafePacketReader interface {
ReadPacketThreadSafe() (buffer *buf.Buffer, addr M.Socksaddr, err error)
}
func IsSafePacketReader ¶
func IsSafePacketReader(reader any) ThreadSafePacketReader
type ThreadSafeReader ¶
func IsSafeReader ¶
func IsSafeReader(reader any) ThreadSafeReader
type ThreadUnsafeWriter ¶
type ThreadUnsafeWriter interface {
WriteIsThreadUnsafe()
}
type TimeoutPacketReader ¶
type TimeoutPacketReader interface { PacketReader SetReadDeadline(t time.Time) error }
type UDPConnectionHandler ¶
type UDPHandler ¶
type VectorisedPacketWriter ¶
type VectorisedWriter ¶
type WithUpstreamReader ¶
type WithUpstreamReader interface {
UpstreamReader() any
}
type WithUpstreamWriter ¶
type WithUpstreamWriter interface {
UpstreamWriter() any
}
type WriterWithMTU ¶
type WriterWithMTU interface {
WriterMTU() int
}
type WriterWithUpstream ¶
type WriterWithUpstream interface {
WriterReplaceable() bool
}
Click to show internal directories.
Click to hide internal directories.