Skip to content

Commit

Permalink
fix(trace-viewer): replace [::1] with localhost for it to work in cod…
Browse files Browse the repository at this point in the history
…econtainers / remote
  • Loading branch information
ruifigueira committed Jul 6, 2024
1 parent c51bbb1 commit 2c1d2e7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/playwrightTestServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ export class PlaywrightTestServer {
private async _createEmbeddedTraceViewer(wsEndpoint: string) {
const serverUrl = new URL(wsEndpoint);
serverUrl.protocol = 'http';
if (this._vscode.env.remoteName && serverUrl.host.startsWith('[::1]'))
serverUrl.host = `localhost:${serverUrl.port}`;
const serverUri = await this._vscode.env.asExternalUri(this._vscode.Uri.parse(serverUrl.origin));
const serverUrlPrefix = serverUri.toString().replace(/\/$/, '');
return new EmbeddedTraceViewer(this._vscode, this._model.extensionUri, this._options.settingsModel, this._model.config, serverUrlPrefix);
Expand Down

0 comments on commit 2c1d2e7

Please sign in to comment.