protocol

package
v0.0.0-...-50172b1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllowVerify byte = 0x12 // 通过验证
	Success     byte = 0x02 // 连接远端成功
	Fail        byte = 0x03 // 连接远端失败
	StringEnd   byte = 0x00 // 字符串结尾
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	IP   net.IP
	Port portT
}

type Parse

type Parse struct{}

func (*Parse) Http503

func (p *Parse) Http503() []byte

Http503 伪装的响应数据

func (*Parse) MessageDecode

func (p *Parse) MessageDecode(raw []byte) (string, *Addr, error)

MessageDecode 服务端正式接受消息的解码

func (*Parse) MessageEncode

func (p *Parse) MessageEncode(password string, addr *Addr) ([]byte, error)

MessageEncode 服务端正式接受消息的编码

func (*Parse) ResponseDecode

func (p *Parse) ResponseDecode(raw []byte) (bool, string, error)

ResponseDecode 服务端响应数据的解码

func (*Parse) ResponseEncode

func (p *Parse) ResponseEncode(status bool, message string) []byte

ResponseEncode 服务端响应数据的编码

type Socks5

type Socks5 struct {
	Conn net.Conn
	Host string

	Addr    *Addr
	Timeout *time.Duration
	// contains filtered or unexported fields
}

func (*Socks5) Error

func (socks5 *Socks5) Error() error

Error 导出错误

func (*Socks5) Fail

func (socks5 *Socks5) Fail() error

func (*Socks5) IpPort

func (socks5 *Socks5) IpPort() *Socks5

IpPort 如果是IP字符串/域名地址则DNS/解析为IPv4/IPv6

func (*Socks5) ParseAddr

func (socks5 *Socks5) ParseAddr() *Socks5

ParseAddr 从socks5握手里获取远程主机和端口

func (*Socks5) Success

func (socks5 *Socks5) Success() error

Jump to

Keyboard shortcuts

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