Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: listen on localhost for html report (#16205)

jfgreffierfb91f829d710
diff --git a/packages/playwright-core/src/utils/httpServer.ts b/packages/playwright-core/src/utils/httpServer.ts
index f5b8a4f78a..db4d6761fd 100644
--- a/packages/playwright-core/src/utils/httpServer.ts
+++ b/packages/playwright-core/src/utils/httpServer.ts
@@ -58,7 +58,7 @@ export class HttpServer {
this._activeSockets.add(socket);
socket.once('close', () => this._activeSockets.delete(socket));
});
- this._server.listen(port, '127.0.0.1');
+ this._server.listen(port, 'localhost');
await new Promise(cb => this._server!.once('listening', cb));
const address = this._server.address();
assert(address, 'Could not bind server socket');
@@ -67,7 +67,7 @@ export class HttpServer {
this._urlPrefix = address;
} else {
this._port = address.port;
- this._urlPrefix = `http://127.0.0.1:${address.port}`;
+ this._urlPrefix = `http://localhost:${address.port}`;
}
}
return this._urlPrefix;