Skip to content

Commit 173b088

Browse files
Eugene Ostroukhovevanlucas
Eugene Ostroukhov
authored andcommitted
inspector: do not prompt to use localhost
There are multiple reports of Windows7 not being able to resolve localhost on some setups (web search also confirms that). This change will advertise "127.0.0.1" as inspector host name. Fixes: #9382 Fixes: #9188 PR-URL: #9451 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0325339 commit 173b088

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/inspector_agent.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static const uint8_t PROTOCOL_JSON[] = {
3939

4040
std::string GetWsUrl(int port, const std::string& id) {
4141
char buf[1024];
42-
snprintf(buf, sizeof(buf), "localhost:%d/%s", port, id.c_str());
42+
snprintf(buf, sizeof(buf), "127.0.0.1:%d/%s", port, id.c_str());
4343
return buf;
4444
}
4545

test/inspector/test-inspector.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function checkListResponse(err, response) {
1111
assert.ok(response[0]['devtoolsFrontendUrl']);
1212
assert.ok(
1313
response[0]['webSocketDebuggerUrl']
14-
.match(/ws:\/\/localhost:\d+\/[0-9A-Fa-f]{8}-/));
14+
.match(/ws:\/\/127.0.0.1:\d+\/[0-9A-Fa-f]{8}-/));
1515
}
1616

1717
function checkVersion(err, response) {

0 commit comments

Comments
 (0)