Documentation ¶
Index ¶
Constants ¶
View Source
const ( // client to server SOCKS5_IPV4 = 0x01 SOCKS5_DOMAIN_NAME = 0x03 SOCKS5_IPV6 = 0x04 SOCKS5_CONNECT_METHOD = 0x01 SOCKS5_BIND_METHOD = 0x02 SOCKS5_ASSOCIATE_METHOD = 0x03 // The maximum packet size of any udp Associate packet, based on ethernet's max size, // minus the IP and UDP headers. IPv4 has a 20 byte header, UDP adds an // additional 4 bytes. This is a total overhead of 24 bytes. Ethernet's // max packet size is 1500 bytes, 1500 - 24 = 1476. SOCKS5_MAX_UDP_PACKET_SIZE = 1476 // server to client SOCKS5_NO_NEED_AUTH = 0x00 SOCKS5_USER_PASS_AUTH = 0x02 SOCKS5_USER_AUTH_VERSION = 0x01 SOCKS5_AUTH_SUCCESS = 0x00 SOCKS5_AUTH_FAILURE = 0x01 SOCKS5_VERSION = 0x05 SOCKS5_CONNECT_SUCC = 0x00 SOCKS5_NETWORK_UNREACHABLE = 0x03 SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED = 0x08 // Address type not supported )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountStore ¶
type AccountStore struct {
// contains filtered or unexported fields
}
线程安全的账号/密码
func NewAccountStore ¶
func NewAccountStore(accts map[string]string) *AccountStore
func (*AccountStore) Compare ¶
func (this *AccountStore) Compare(username, passwd string) int
0-成功 1-用户不存在 2-密码错误
func (AccountStore) Lock ¶
func (this AccountStore) Lock()
func (*AccountStore) Size ¶
func (this *AccountStore) Size() int
func (AccountStore) Unlock ¶
func (this AccountStore) Unlock()
func (*AccountStore) Upsert ¶
func (this *AccountStore) Upsert(username, passwd string)
type ProxyFunc ¶
type ProxyFunc func(conn net.Conn, callback smartnet.StopCallBackFunc)
callback写法有点丑 但能有效减少协程数 FIXME 用hub+channel方式 避免跨线程调用风险
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Connections ¶
Click to show internal directories.
Click to hide internal directories.