소스 검색

Fix socks authentication

V2Ray 10 년 전
부모
커밋
5cee727308
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      proxy/socks/socks.go
  2. 1 1
      proxy/socks/socks_test.go

+ 1 - 1
proxy/socks/socks.go

@@ -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)

+ 1 - 1
proxy/socks/socks_test.go

@@ -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",