diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 7f82b7b0516fa6..44c7501375e3eb 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -39,7 +39,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; } diff --git a/test/inspector/test-inspector.js b/test/inspector/test-inspector.js index d3d0bbd55923c1..75c645bb222781 100644 --- a/test/inspector/test-inspector.js +++ b/test/inspector/test-inspector.js @@ -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) {