Documentation ¶
Index ¶
Constants ¶
View Source
const SocksUPCheckVersion = 1
View Source
const SocksVersion = 5
Variables ¶
View Source
var ( SocksAuthNotRequired = []byte{SocksVersion, 0} SocksAuthUserPasswd = []byte{SocksVersion, 2} SocksAuthMethodNotMatch = []byte{SocksVersion, 0xFF} SocksUPAuthSuccess = []byte{SocksUPCheckVersion, 0} SocksUPAuthFail = []byte{SocksUPCheckVersion, 1} SocksReplySuccess = []byte{SocksVersion, 0, 0, 1, 0, 0, 0, 0, 0, 0} SocksReplyServerFail = []byte{SocksVersion, 1, 0, 1, 0, 0, 0, 0, 0, 0} SocksReplyNotAllowed = []byte{SocksVersion, 2, 0, 1, 0, 0, 0, 0, 0, 0} SocksReplyNetworkUnreachable = []byte{SocksVersion, 3, 0, 1, 0, 0, 0, 0, 0, 0} SocksReplyHostUnreachable = []byte{SocksVersion, 4, 0, 1, 0, 0, 0, 0, 0, 0} SocksReplyRefused = []byte{SocksVersion, 5, 0, 1, 0, 0, 0, 0, 0, 0} SocksReplyTTLExpired = []byte{SocksVersion, 6, 0, 1, 0, 0, 0, 0, 0, 0} SocksReplyInvalidCommand = []byte{SocksVersion, 7, 0, 1, 0, 0, 0, 0, 0, 0} SocksReplyInvalidAddrType = []byte{SocksVersion, 8, 0, 1, 0, 0, 0, 0, 0, 0} )
Functions ¶
This section is empty.
Types ¶
type SimpleAuth ¶
func NewSimpleAuth ¶
func NewSimpleAuth() SimpleAuth
func (SimpleAuth) Check ¶
func (s SimpleAuth) Check(user, passwd string) bool
type Socks5Server ¶
type Socks5Server struct {
// contains filtered or unexported fields
}
func NewSocks5Server ¶
func NewSocks5Server(addr string, t SocksTunnel, auth SocksAuth) (*Socks5Server, error)
func (*Socks5Server) Run ¶
func (ss *Socks5Server) Run()
type SocksTunnel ¶
type SocksTunnel interface { DoDomainProxy(domain string, port int, rw io.ReadWriteCloser) DoIPProxy(addr []byte, port int, rw io.ReadWriteCloser) }
Click to show internal directories.
Click to hide internal directories.