diff --git a/renderdoc/core/target_control.cpp b/renderdoc/core/target_control.cpp index a61955cb2..6811321c9 100644 --- a/renderdoc/core/target_control.cpp +++ b/renderdoc/core/target_control.cpp @@ -679,13 +679,13 @@ extern "C" RENDERDOC_API TargetControl *RENDERDOC_CC RENDERDOC_CreateTargetContr if(host != NULL && host[0] != '\0') s = host; - bool localhost = (s == "localhost"); - Network::Socket *sock = Network::CreateClientSocket(s.c_str(), ident & 0xffff, 3000); if(sock == NULL) return NULL; + bool localhost = Network::GetIPOctet(sock->GetRemoteIP(), 0) == 127; + TargetControl *remote = new TargetControl(sock, clientName, forceConnection != 0, localhost); if(remote->Connected())