Documentation ¶
Index ¶
- Constants
- Variables
- func AddrFromIP(ip net.IP) netip.Addr
- func AddrFromNetAddr(netAddr net.Addr) netip.Addr
- func AddrPortFrom(ip net.IP, port uint16) netip.AddrPort
- func AddrPortFromNet(netAddr net.Addr) netip.AddrPort
- func IsDomainName(domain string) bool
- func NetworkFromNetAddr(network string, addr netip.Addr) string
- func ParseAddr(address string) netip.Addr
- func ReadSockString(reader io.Reader) (string, error)
- func WriteSocksString(buffer *buf.Buffer, str string) error
- type Family
- type Metadata
- type Serializer
- func (s *Serializer) AddrPortLen(destination Socksaddr) int
- func (s *Serializer) AddressLen(addr Socksaddr) int
- func (s *Serializer) ReadAddrPort(reader io.Reader) (destination Socksaddr, err error)
- func (s *Serializer) ReadAddress(reader io.Reader) (Socksaddr, error)
- func (s *Serializer) ReadPort(reader io.Reader) (uint16, error)
- func (s *Serializer) WriteAddrPort(writer io.Writer, destination Socksaddr) error
- func (s *Serializer) WriteAddress(buffer *buf.Buffer, addr Socksaddr) error
- func (s *Serializer) WritePort(writer io.Writer, port uint16) error
- type SerializerOption
- type Socksaddr
- func ParseSocksaddr(address string) Socksaddr
- func ParseSocksaddrHostPort(host string, port uint16) Socksaddr
- func ParseSocksaddrHostPortStr(host string, portStr string) Socksaddr
- func SocksaddrFrom(addr netip.Addr, port uint16) Socksaddr
- func SocksaddrFromNet(ap net.Addr) Socksaddr
- func SocksaddrFromNetIP(ap netip.AddrPort) Socksaddr
- func (ap Socksaddr) AddrPort() netip.AddrPort
- func (ap Socksaddr) AddrString() string
- func (ap Socksaddr) CheckBadAddr()
- func (ap Socksaddr) IPAddr() *net.IPAddr
- func (ap Socksaddr) IsFqdn() bool
- func (ap Socksaddr) IsIP() bool
- func (ap Socksaddr) IsIPv4() bool
- func (ap Socksaddr) IsIPv6() bool
- func (ap Socksaddr) IsValid() bool
- func (ap Socksaddr) Network() string
- func (ap Socksaddr) String() string
- func (ap Socksaddr) TCPAddr() *net.TCPAddr
- func (ap Socksaddr) UDPAddr() *net.UDPAddr
- func (ap Socksaddr) Unwrap() Socksaddr
Constants ¶
View Source
const ( MaxSocksaddrLength = 2 + 255 + 2 MaxIPSocksaddrLength = 1 + 16 + 2 )
Variables ¶
View Source
var SocksaddrSerializer = NewSerializer( AddressFamilyByte(0x01, AddressFamilyIPv4), AddressFamilyByte(0x04, AddressFamilyIPv6), AddressFamilyByte(0x03, AddressFamilyFqdn), )
Functions ¶
func IsDomainName ¶
Types ¶
type Serializer ¶
type Serializer struct {
// contains filtered or unexported fields
}
func NewSerializer ¶
func NewSerializer(options ...SerializerOption) *Serializer
func (*Serializer) AddrPortLen ¶
func (s *Serializer) AddrPortLen(destination Socksaddr) int
func (*Serializer) AddressLen ¶
func (s *Serializer) AddressLen(addr Socksaddr) int
func (*Serializer) ReadAddrPort ¶
func (s *Serializer) ReadAddrPort(reader io.Reader) (destination Socksaddr, err error)
func (*Serializer) ReadAddress ¶
func (s *Serializer) ReadAddress(reader io.Reader) (Socksaddr, error)
func (*Serializer) WriteAddrPort ¶
func (s *Serializer) WriteAddrPort(writer io.Writer, destination Socksaddr) error
func (*Serializer) WriteAddress ¶
func (s *Serializer) WriteAddress(buffer *buf.Buffer, addr Socksaddr) error
type SerializerOption ¶
type SerializerOption func(*Serializer)
func AddressFamilyByte ¶
func AddressFamilyByte(b byte, f Family) SerializerOption
func PortThenAddress ¶
func PortThenAddress() SerializerOption
type Socksaddr ¶
func ParseSocksaddr ¶
func ParseSocksaddrHostPort ¶
func SocksaddrFromNet ¶
func SocksaddrFromNetIP ¶
func (Socksaddr) AddrString ¶
func (Socksaddr) CheckBadAddr ¶
func (ap Socksaddr) CheckBadAddr()
Click to show internal directories.
Click to hide internal directories.