Documentation
¶
Index ¶
- func Splice(tun tun.Device, conn Connection) error
- type Connection
- type MuxedConnection
- func (m *MuxedConnection) AddConnection(prefix netip.Prefix, conn Connection)
- func (m *MuxedConnection) Close() error
- func (m *MuxedConnection) Prefixes() []netip.Prefix
- func (m *MuxedConnection) ReadPacket(pkt []byte) (int, error)
- func (m *MuxedConnection) RemoveConnection(prefix netip.Prefix) error
- func (m *MuxedConnection) WritePacket(pkt []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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)
Click to show internal directories.
Click to hide internal directories.