Documentation
¶
Overview ¶
Package vision implements VLESS flow `xtls-rprx-vision` introduced by Xray-core.
Index ¶
- Constants
- Variables
- func ApplyPaddingFromPool(p []byte, command byte, userUUID []byte, longPadding bool) (prefix, suffix pool.PB)
- func IPAddrToPacketAddrLength(addr netip.AddrPort) int
- func PutPacketAddr(src []byte, addr netip.AddrPort) error
- func ReadPacketAddr(p []byte) (addr netip.AddrPort, err error)
- func ReshapeBytes(b []byte) (_ []byte, b2 []byte)
- type Conn
- type PacketConn
Constants ¶
const ( PaddingHeaderLen = len(uuid.Nil) + 1 + 2 + 2 // =21 BufferSize = 32 * 1024 )
Variables ¶
var ErrNotTLS13 = errors.New("XTLS Vision based on TLS 1.3 outer connection")
Functions ¶
func ApplyPaddingFromPool ¶
func ReshapeBytes ¶
Types ¶
type Conn ¶
type PacketConn ¶
type PacketConn struct {
*Conn
// contains filtered or unexported fields
}
func NewPacketConn ¶
func (*PacketConn) ReadFrom ¶
+-------------------+-------------------+ | Frame Length (2B) | Frame Header (4B) | +-------------------+-------------------+ |Net Type (1B) | PORT (2B) | IP Type (1B) | IP Address | +-------------------+-------------------+ | Length Data | Payload | +-------------------+-------------------+
func (*PacketConn) WriteTo ¶
func (pc *PacketConn) WriteTo(p []byte, addr string) (n int, err error)
+------------------------+------------------------+ | Metadata Length (2B) | Session ID (2B) | +------------------------+------------------------+ | Type (1B) | Options (1B) | | (New=1/Keep=2) | | +------------------------+------------------------+ | Protocol Type (1B) | | +------------------------+ | | Target Address | Port | | (Variable) | | +------------------------+------------------------+ | Global ID (8B) | | | (Optional) | | +------------------------+------------------------+ | Data Length (2B) | Payload | +------------------------+------------------------+