Documentation
¶
Overview ¶
Package protocol defines the packet format and types for the P2P tunnel.
Index ¶
Constants ¶
View Source
const ( TypeConnect uint8 = 0x01 // New TCP connection request TypeData uint8 = 0x02 // TCP data payload TypeClose uint8 = 0x03 // Connection close notification )
Packet type constants.
View Source
const HeaderSize = 9
HeaderSize is the fixed header size: Type(1) + SocketID(4) + SeqNum(4).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Packet ¶
type Packet struct {
Type uint8 // TypeConnect, TypeData, or TypeClose
SocketID uint32 // Hashed identifier from 4-tuple
SeqNum uint32 // Per-socketID sequence number
Payload []byte // Only used for TypeData
}
Packet represents a tunnel protocol packet transmitted over the DataChannel.
Click to show internal directories.
Click to hide internal directories.