Documentation ¶
Index ¶
Constants ¶
View Source
const ( AtypIPv4 = 1 AtypDomainName = 3 AtypIPv6 = 4 )
- Requests Once the method-dependent subnegotiation has completed, the client sends the request details. If the negotiated method includes encapsulation for purposes of integrity checking and/or confidentiality, these requests MUST be encapsulated in the method- dependent encapsulation. The SOCKS request is formed as follows: +----+-----+-------+------+----------+----------+ |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT | +----+-----+-------+------+----------+----------+ | 1 | 1 | X’00’ | 1 | Variable | 2 | +----+-----+-------+------+----------+----------+
Where:
o VER protocol version: X’05’ o CMD o CONNECT X’01’ o BIND X’02’ o UDP ASSOCIATE X’03’ o RSV RESERVED o ATYP address type of following address o IP V4 address: X’01’ o DOMAINNAME: X’03’ o IP V6 address: X’04’ o DST.ADDR desired destination address o DST.PORT desired destination port in network octet
order
The SOCKS server will typically evaluate the request based on source and destination addresses, and return one or more reply messages, as appropriate for the request type.
- Addressing In an address field (DST.ADDR, BND.ADDR), the ATYP field specifies the type of address contained within the field: o X’01’ the address is a version-4 IP address, with a length of 4 octets
o X’03’
the address field contains a fully-qualified domain name. The first octet of the address field contains the number of octets of name that follow, there is no terminating NUL octet. o X’04’ the address is a version-6 IP address, with a length of 16 octets.
View Source
const ( CmdConnect = 1 CmdBind = 2 CmdUDPAssociate = 3 )
View Source
const ( ErrCommandNotSupported = Error(1) ErrAddressNotSupported = Error(2) InfoUDPAssociate = Error(3) )
View Source
const MaxAddrLen = 1 + 1 + 255 + 2
View Source
const (
MinerTimeOut = time.Second * 5
)
Variables ¶
This section is empty.
Functions ¶
func Socks5Target ¶
Types ¶
type LocalProxyApi ¶
type SimpleTunReader ¶
type SimpleTunReader struct { }
func NewTunReader ¶
func NewTunReader() *SimpleTunReader
func (*SimpleTunReader) Finish ¶
func (str *SimpleTunReader) Finish()
func (*SimpleTunReader) InputPacket ¶
func (str *SimpleTunReader) InputPacket(data []byte)
func (*SimpleTunReader) Proxying ¶
func (str *SimpleTunReader) Proxying(chan error)
func (*SimpleTunReader) RemoveFromSession ¶
func (str *SimpleTunReader) RemoveFromSession(keyPort int)
Click to show internal directories.
Click to hide internal directories.