address_parser

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

vmess,vless

Functions

This section is empty.

Types

type AddressParser

type AddressParser interface {
	// read from input, and put address and port into buffer, buffer can be nil, if so, a new buffer will be created
	// if input is a buf.Buffer, its internal end will change
	ReadAddressPort(buffer *buf.Buffer, input io.Reader) (net.Address, net.Port, error)
	WriteAddressPort(writer io.Writer, addr net.Address, port net.Port) error
	PeekAddressPort(buffer *buf.Buffer) (net.Address, net.Port, error)
}

read address and port from bytes or write address and port to bytes, used in mux

func NewAddressParser

func NewAddressParser(byteToAddressFamily map[byte]net.AddressFamily, portFirst bool, typeParser AddressTypeParser) AddressParser

NewAddressParser creates a new AddressParser

type AddressTypeParser

type AddressTypeParser func(byte) byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL