addr

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePort

func ParsePort(port string) (uint16, error)

Types

type Addr

type Addr struct {
	Host string
	Port uint16
}

func NewAddr added in v1.2.0

func NewAddr(host string, port uint16) *Addr

func ParseAddr added in v1.2.0

func ParseAddr(addr string) (*Addr, error)

func (*Addr) MarshalText

func (a *Addr) MarshalText() ([]byte, error)

func (*Addr) String

func (a *Addr) String() string

func (*Addr) UnmarshalText

func (a *Addr) UnmarshalText(text []byte) error

type Proto added in v1.2.0

type Proto int
const (
	ProtoSOCKS Proto = iota + 1
	ProtoSOCKS4
	ProtoSOCKS4a
	ProtoSOCKS5
	ProtoSOCKS5h

	ProtoHTTP
)

func ParseProto added in v1.2.0

func ParseProto(proto string) (Proto, error)

func (Proto) MarshalText added in v1.2.0

func (p Proto) MarshalText() ([]byte, error)

func (Proto) String added in v1.2.0

func (p Proto) String() string

func (*Proto) UnmarshalText added in v1.2.0

func (p *Proto) UnmarshalText(text []byte) error

type URL added in v1.2.0

type URL struct {
	Proto Proto

	Host string
	Port uint16
}

func NewURL added in v1.2.0

func NewURL(proto Proto, host string, port uint16) *URL

func ParseURL added in v1.2.0

func ParseURL(url string, defProto Proto) (*URL, error)

func (*URL) Addr added in v1.2.0

func (u *URL) Addr() *Addr

func (*URL) IsZero added in v1.2.0

func (u *URL) IsZero() bool

func (*URL) MarshalText added in v1.2.0

func (u *URL) MarshalText() ([]byte, error)

func (*URL) String added in v1.2.0

func (u *URL) String() string

func (*URL) UnmarshalText added in v1.2.0

func (u *URL) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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