Documentation
¶
Index ¶
- type ClientConfig
- type ClientTransport
- type Connection
- type MuxedConnection
- func (m *MuxedConnection) AddConnection(prefix netip.Prefix, conn Connection)
- func (m *MuxedConnection) Close() error
- func (m *MuxedConnection) ReadPacket(pkt []byte) (int, error)
- func (m *MuxedConnection) RemoveConnection(prefix netip.Prefix) error
- func (m *MuxedConnection) WritePacket(pkt []byte) ([]byte, error)
- type ServerConfig
- type ServerTransport
- type TunnelTransport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
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) FowardToLoopback ¶
func (t *ClientTransport) FowardToLoopback(ctx context.Context) error
FowardToLoopback forwards all inbound traffic to the loopback interface.
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 ¶
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
Click to show internal directories.
Click to hide internal directories.