Documentation
¶
Index ¶
- type Manager
- type VirtualConn
- func (v *VirtualConn) Close() error
- func (v *VirtualConn) LocalAddr() net.Addr
- func (v *VirtualConn) Read(b []byte) (n int, err error)
- func (v *VirtualConn) RemoteAddr() net.Addr
- func (v *VirtualConn) SetDeadline(t time.Time) error
- func (v *VirtualConn) SetReadDeadline(t time.Time) error
- func (v *VirtualConn) SetWriteDeadline(t time.Time) error
- func (v *VirtualConn) SwapConnection(newConn net.Conn)
- func (v *VirtualConn) SwapConnectionSeamless(newConn net.Conn) error
- func (v *VirtualConn) Write(b []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles the lifecycle of underlying network connections and seamless switching between them using Yamux session resumption. Uses MTP (Mimic Transport Protocol) over UDP for anti-DPI transport.
func NewManager ¶
NewManager creates a new transport manager
func (*Manager) GetMTPConn ¶
GetMTPConn returns the current MTP connection (for stats)
func (*Manager) RotateTransport ¶
RotateTransport switches the underlying transport to a new domain while keeping the Yamux session alive via MTP session migration.
type VirtualConn ¶
type VirtualConn struct {
// contains filtered or unexported fields
}
VirtualConn is a persistent connection wrapper that can switch its underlying physical connection. This allows upper layers (like Yamux) to think they have a stable connection. It supports buffered seamless swap to prevent data loss during transport rotation.
func NewVirtualConn ¶
func NewVirtualConn(conn net.Conn) *VirtualConn
func (*VirtualConn) Close ¶
func (v *VirtualConn) Close() error
func (*VirtualConn) LocalAddr ¶
func (v *VirtualConn) LocalAddr() net.Addr
func (*VirtualConn) RemoteAddr ¶
func (v *VirtualConn) RemoteAddr() net.Addr
func (*VirtualConn) SetDeadline ¶
func (v *VirtualConn) SetDeadline(t time.Time) error
func (*VirtualConn) SetReadDeadline ¶
func (v *VirtualConn) SetReadDeadline(t time.Time) error
func (*VirtualConn) SetWriteDeadline ¶
func (v *VirtualConn) SetWriteDeadline(t time.Time) error
func (*VirtualConn) SwapConnection ¶
func (v *VirtualConn) SwapConnection(newConn net.Conn)
SwapConnection replaces the underlying connection with a new one. The old connection is NOT closed here, caller handles it.
func (*VirtualConn) SwapConnectionSeamless ¶
func (v *VirtualConn) SwapConnectionSeamless(newConn net.Conn) error
SwapConnectionSeamless replaces the underlying connection with buffered transition. Writes during the swap are captured and replayed on the new connection.