Skip to content

Commit

Permalink
inspector: do not prompt to use localhost
Browse files Browse the repository at this point in the history
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 <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Eugene Ostroukhov authored and Myles Borins committed Nov 22, 2016
1 parent 0216dbe commit cf5a00e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static const uint8_t PROTOCOL_JSON[] = {

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

Expand Down
2 changes: 1 addition & 1 deletion test/inspector/test-inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function checkListResponse(err, response) {
assert.ok(response[0]['devtoolsFrontendUrl']);
assert.ok(
response[0]['webSocketDebuggerUrl']
.match(/ws:\/\/localhost:\d+\/[0-9A-Fa-f]{8}-/));
.match(/ws:\/\/127.0.0.1:\d+\/[0-9A-Fa-f]{8}-/));
}

function checkVersion(err, response) {
Expand Down

0 comments on commit cf5a00e

Please sign in to comment.