Fix socks authentication

pull/40/head
V2Ray 2015-10-10 22:31:25 +02:00
parent 1652b3f7f0
commit 5cee727308
2 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ func (server *SocksServer) handleSocks5(reader *v2net.TimeOutReader, writer io.W
return err
}
status := byte(0)
if server.config.HasAccount(upRequest.Username(), upRequest.Password()) {
if !server.config.HasAccount(upRequest.Username(), upRequest.Password()) {
status = byte(0xFF)
}
upResponse := protocol.NewSocks5UserPassResponse(status)

View File

@ -83,7 +83,7 @@ func TestSocksTcpConnectWithUserPass(t *testing.T) {
InboundConfigValue: &mocks.ConnectionConfig{
ProtocolValue: "socks",
SettingsValue: &json.SocksConfig{
AuthMethod: "noauth",
AuthMethod: "password",
Accounts: []json.SocksAccount{
json.SocksAccount{
Username: "userx",