From fb91f829d710835ffd4a328f8cd92ef90b3b7625 Mon Sep 17 00:00:00 2001 From: jfgreffier Date: Wed, 10 Aug 2022 11:05:31 +0200 Subject: [PATCH] chore: listen on localhost for html report (#16205) --- packages/playwright-core/src/utils/httpServer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;