mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
Fix socks authentication
This commit is contained in:
parent
1652b3f7f0
commit
5cee727308
@ -103,7 +103,7 @@ func (server *SocksServer) handleSocks5(reader *v2net.TimeOutReader, writer io.W
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
status := byte(0)
|
status := byte(0)
|
||||||
if server.config.HasAccount(upRequest.Username(), upRequest.Password()) {
|
if !server.config.HasAccount(upRequest.Username(), upRequest.Password()) {
|
||||||
status = byte(0xFF)
|
status = byte(0xFF)
|
||||||
}
|
}
|
||||||
upResponse := protocol.NewSocks5UserPassResponse(status)
|
upResponse := protocol.NewSocks5UserPassResponse(status)
|
||||||
|
@ -83,7 +83,7 @@ func TestSocksTcpConnectWithUserPass(t *testing.T) {
|
|||||||
InboundConfigValue: &mocks.ConnectionConfig{
|
InboundConfigValue: &mocks.ConnectionConfig{
|
||||||
ProtocolValue: "socks",
|
ProtocolValue: "socks",
|
||||||
SettingsValue: &json.SocksConfig{
|
SettingsValue: &json.SocksConfig{
|
||||||
AuthMethod: "noauth",
|
AuthMethod: "password",
|
||||||
Accounts: []json.SocksAccount{
|
Accounts: []json.SocksAccount{
|
||||||
json.SocksAccount{
|
json.SocksAccount{
|
||||||
Username: "userx",
|
Username: "userx",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user