Documentation
¶
Index ¶
- Constants
- func Splice(tun tun.Device, conn Connection) error
- 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 ¶
View Source
const (
ApplicationCodeOK quic.ApplicationErrorCode = 0x0
)
Variables ¶
This section is empty.
Functions ¶
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
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 ¶
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.