Skip to content

Commit

Permalink
🐛 Use localhost when exporting to browser; Fixes #23
Browse files Browse the repository at this point in the history
This is a cop-out, and may be an incomplete fix,
but browsers are increasingly careful about where they load
resources from. localhost has a separate (and for some browsers, special) meaning that is distinct from the IP address, so we're going to lean that way.
  • Loading branch information
ebullient committed Sep 4, 2024
1 parent fb000bb commit 82ca0f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/reveal/revealServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class RevealServer {
}

getUrl(): URL {
return new URL(`http://127.0.0.1:${this._port}`);
return new URL(`http://localhost:${this._port}`);
}

getTargetUrl(target: TAbstractFile): URL {
Expand All @@ -128,7 +128,7 @@ export class RevealServer {
return;
}
try {
await this._server.listen({ host: '127.0.0.1', port: this._port });
await this._server.listen({ host: 'localhost', port: this._port });
console.info(
'Slides Extended is ready to go.',
this._server.listeningOrigin,
Expand Down

0 comments on commit 82ca0f3

Please sign in to comment.