protocol

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LenToken       = 56
	LenCRLF        = 2
	LenCommand     = 1
	LenAddressType = 1
	LenIPv4        = 4
	LenDomain      = 1
	LenIPv6        = 16
	LenPort        = 2

	CommandConnect = 0x01
	CommandUDP     = 0x03

	AddressTypeIPv4   = 0x01
	AddressTypeDomain = 0x03
	AddressTypeIPv6   = 0x04
)

Variables

View Source
var (
	CRLF = []byte{'\x0D', '\x0A'}
)

Functions

func GetToken

func GetToken(conn net.Conn) (string, error)

Types

type Request

type Request struct {
	Command            byte
	AddressType        byte
	DescriptionAddress string
	DescriptionPort    int
}

func ParseRequest

func ParseRequest(conn net.Conn) (*Request, error)

Jump to

Keyboard shortcuts

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