singbridge

package
v1.8.16 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyConn

func CopyConn(ctx context.Context, inboundConn net.Conn, link *transport.Link, serverConn net.Conn) error

func CopyPacketConn

func CopyPacketConn(ctx context.Context, inboundConn net.Conn, link *transport.Link, destination net.Destination, serverConn net.PacketConn) error

func ReturnError

func ReturnError(err error) error

func ToDestination

func ToDestination(socksaddr M.Socksaddr, network net.Network) net.Destination

func ToNetwork

func ToNetwork(network string) net.Network

func ToSocksaddr

func ToSocksaddr(destination net.Destination) M.Socksaddr

Types

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewConn

func NewConn(conn net.Conn) *Conn

func (*Conn) ReadMultiBuffer

func (c *Conn) ReadMultiBuffer() (buf.MultiBuffer, error)

func (*Conn) ReadMultiBufferTimeout

func (c *Conn) ReadMultiBufferTimeout(duration time.Duration) (buf.MultiBuffer, error)

func (*Conn) WriteMultiBuffer

func (c *Conn) WriteMultiBuffer(bufferList buf.MultiBuffer) error

type Dispatcher

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

func NewDispatcher

func NewDispatcher(dispatcher routing.Dispatcher, newErrorFunc func(values ...any) *errors.Error) *Dispatcher

func (*Dispatcher) NewConnection

func (d *Dispatcher) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error

func (*Dispatcher) NewError

func (d *Dispatcher) NewError(ctx context.Context, err error)

func (*Dispatcher) NewPacketConnection

func (d *Dispatcher) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata M.Metadata) error

type PacketConnWrapper

type PacketConnWrapper struct {
	buf.Reader
	buf.Writer
	net.Conn
	Dest net.Destination
	// contains filtered or unexported fields
}

func (*PacketConnWrapper) Close

func (w *PacketConnWrapper) Close() error

func (*PacketConnWrapper) ReadPacket

func (w *PacketConnWrapper) ReadPacket(buffer *B.Buffer) (M.Socksaddr, error)

func (*PacketConnWrapper) WritePacket

func (w *PacketConnWrapper) WritePacket(buffer *B.Buffer, destination M.Socksaddr) error

type PipeConnWrapper

type PipeConnWrapper struct {
	R io.Reader
	W buf.Writer
	net.Conn
}

func (*PipeConnWrapper) Close

func (w *PipeConnWrapper) Close() error

func (*PipeConnWrapper) Read

func (w *PipeConnWrapper) Read(b []byte) (n int, err error)

func (*PipeConnWrapper) Write

func (w *PipeConnWrapper) Write(p []byte) (n int, err error)

type XrayDialer

type XrayDialer struct {
	internet.Dialer
}

func NewDialer

func NewDialer(dialer internet.Dialer) *XrayDialer

func (*XrayDialer) DialContext

func (d *XrayDialer) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*XrayDialer) ListenPacket

func (d *XrayDialer) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

type XrayLogger

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

func NewLogger

func NewLogger(newErrorFunc func(values ...any) *errors.Error) *XrayLogger

func (*XrayLogger) Debug

func (l *XrayLogger) Debug(args ...any)

func (*XrayLogger) DebugContext

func (l *XrayLogger) DebugContext(ctx context.Context, args ...any)

func (*XrayLogger) Error

func (l *XrayLogger) Error(args ...any)

func (*XrayLogger) ErrorContext

func (l *XrayLogger) ErrorContext(ctx context.Context, args ...any)

func (*XrayLogger) Fatal

func (l *XrayLogger) Fatal(args ...any)

func (*XrayLogger) FatalContext

func (l *XrayLogger) FatalContext(ctx context.Context, args ...any)

func (*XrayLogger) Info

func (l *XrayLogger) Info(args ...any)

func (*XrayLogger) InfoContext

func (l *XrayLogger) InfoContext(ctx context.Context, args ...any)

func (*XrayLogger) Panic

func (l *XrayLogger) Panic(args ...any)

func (*XrayLogger) PanicContext

func (l *XrayLogger) PanicContext(ctx context.Context, args ...any)

func (*XrayLogger) Trace

func (l *XrayLogger) Trace(args ...any)

func (*XrayLogger) TraceContext

func (l *XrayLogger) TraceContext(ctx context.Context, args ...any)

func (*XrayLogger) Warn

func (l *XrayLogger) Warn(args ...any)

func (*XrayLogger) WarnContext

func (l *XrayLogger) WarnContext(ctx context.Context, args ...any)

type XrayOutboundDialer

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

func NewOutboundDialer

func NewOutboundDialer(outbound proxy.Outbound, dialer internet.Dialer) *XrayOutboundDialer

func (*XrayOutboundDialer) DialContext

func (d *XrayOutboundDialer) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*XrayOutboundDialer) ListenPacket

func (d *XrayOutboundDialer) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

Jump to

Keyboard shortcuts

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