connection

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Splice

func Splice(tun tun.Device, conn Connection) error

Types

type Connection

type Connection interface {
	io.Closer
	ReadPacket([]byte) (int, error)
	WritePacket([]byte) ([]byte, error)
}

Connection is a simple interface implemented by connect-ip-go and custom connection types.

type MuxedConnection

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

MuxedConnection is a connection that multiplexes multiple downstream connections over a single virtual connection.

func NewMuxedConnection

func NewMuxedConnection() *MuxedConnection

func (*MuxedConnection) AddConnection

func (m *MuxedConnection) AddConnection(prefix netip.Prefix, conn Connection)

func (*MuxedConnection) Close

func (m *MuxedConnection) Close() error

func (*MuxedConnection) Prefixes

func (m *MuxedConnection) Prefixes() []netip.Prefix

func (*MuxedConnection) ReadPacket

func (m *MuxedConnection) ReadPacket(pkt []byte) (int, error)

func (*MuxedConnection) RemoveConnection

func (m *MuxedConnection) RemoveConnection(prefix netip.Prefix) error

func (*MuxedConnection) WritePacket

func (m *MuxedConnection) WritePacket(pkt []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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