Documentation ¶
Index ¶
- Constants
- func Dial(network, targetAddress, proxyAddress string, auth *proxy.Auth, ...) (net.Conn, error)
- func ParseDestConnFrom(src net.Conn, auth *proxy.Auth) (net.Conn, error)
- func Transfer(src net.Conn, closed bool, auth *proxy.Auth, recovered bool) (chan iokit.Direction, error)
- func TransferFromListen(lAddr *net.TCPAddr, auth *proxy.Auth, keepListening bool, ...) error
- func TransferFromListenAddress(lAddress string, auth *proxy.Auth, keepListening bool, ...) error
- type Credential
- type SocksAuthenticationPacket
- type SocksBasicPacket
- type SocksConfig
- type SocksDetailPacket
- type SocksServer
- type SocksTransferContext
Constants ¶
View Source
const ( UserPassword = 0x02 None = 0x00 )
View Source
const ( VerifySuccess = 0x00 VerifyFailure = 0x01 )
Variables ¶
This section is empty.
Functions ¶
func TransferFromListen ¶
Types ¶
type Credential ¶
type SocksBasicPacket ¶
*
The localConn connects to the dstServer, and sends a ver identifier/method selection message: +----+----------+----------+ |VER | NMETHODS | METHODS | +----+----------+----------+ | 1 | 1 | 1 to 255 | +----+----------+----------+ The VER field is set to X'05' for this ver of the protocol. The NMETHODS field contains the number of method identifier octets that appear in the METHODS field.
第一个字段VER代表Socks的版本,Socks5默认为0x05,其固定长度为1个字节
type SocksConfig ¶
type SocksDetailPacket ¶
type SocksDetailPacket struct { Packet []byte Version byte CMD byte RSV byte ATYP byte DST_ADDR []byte DST_PORT []byte }
*
+----+-----+-------+------+----------+----------+ |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT | +----+-----+-------+------+----------+----------+ | 1 | 1 | X'00' | 1 | Variable | 2 | +----+-----+-------+------+----------+----------+
func (SocksDetailPacket) GetAddr ¶
func (p SocksDetailPacket) GetAddr() (string, error)
func (SocksDetailPacket) GetAddress ¶
func (p SocksDetailPacket) GetAddress() (string, error)
func (SocksDetailPacket) GetPort ¶
func (p SocksDetailPacket) GetPort() int
type SocksServer ¶
func (SocksServer) ParseIntoPacket ¶
func (s SocksServer) ParseIntoPacket() (*SocksDetailPacket, error)
type SocksTransferContext ¶
type SocksTransferContext struct { LAddr *net.TCPAddr DAddr *net.TCPAddr KeepListening bool LListener *net.TCPListener DListener *net.TCPListener StopChan *chan os.Signal }
func BuildTransfer ¶
func BuildTransfer(lAddress string, keepListening bool) (*SocksTransferContext, error)
func (SocksTransferContext) GetDListener ¶
func (t SocksTransferContext) GetDListener() *net.TCPListener
func (SocksTransferContext) GetLListener ¶
func (t SocksTransferContext) GetLListener() *net.TCPListener
func (SocksTransferContext) Stop ¶
func (t SocksTransferContext) Stop()
func (SocksTransferContext) TransferFromListen ¶
func (t SocksTransferContext) TransferFromListen(auth *proxy.Auth) error
Click to show internal directories.
Click to hide internal directories.