connip

package
v0.8.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ApplicationCodeOK quic.ApplicationErrorCode = 0x0
)

Variables

This section is empty.

Functions

func Splice added in v0.8.4

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

Types

type ClientConfig

type ClientConfig struct {
	// The UUID identifying the client.
	UUID uuid.UUID
	// The authentication token for the client.
	AuthToken string
	// The optional path to a packet capture file.
	PcapPath string
	// Optional root CA certificates for TLS verification.
	RootCAs *x509.CertPool
	// Optional flag to skip TLS verification.
	InsecureSkipVerify bool
}

type ClientTransport

type ClientTransport struct {
	*network.NetstackNetwork
	// contains filtered or unexported fields
}

func NewClientTransport

func NewClientTransport(conf *ClientConfig) *ClientTransport

func (*ClientTransport) Close

func (t *ClientTransport) Close() error

func (*ClientTransport) Connect

func (t *ClientTransport) Connect(ctx context.Context, serverAddr string) error

func (*ClientTransport) FowardTo added in v0.8.4

func (t *ClientTransport) FowardTo(ctx context.Context, upstream network.Network) error

FowardTo forwards all inbound traffic to the upstream network.

func (*ClientTransport) LocalAddresses added in v0.8.4

func (t *ClientTransport) LocalAddresses() ([]netip.Prefix, error)

LocalAddresses returns the local addresses assigned to the client.

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) 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)

type ServerConfig

type ServerConfig struct {
}

type ServerTransport

type ServerTransport struct {
	network.Network
}

func NewServerTransport

func NewServerTransport(conf *ServerConfig) *ServerTransport

func (*ServerTransport) Close

func (t *ServerTransport) Close() error

func (*ServerTransport) ListenForConnections

func (t *ServerTransport) ListenForConnections(ctx context.Context) error

type TunnelTransport

type TunnelTransport interface {
	io.Closer
	network.Network
}

Jump to

Keyboard shortcuts

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