Skip to content

Commit

Permalink
fix: Use 127.0.0.1 ipv4 instead of localhost to avoid ipv6 conflicts (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
no2chem authored Sep 3, 2024
1 parent b90f4f6 commit 46fb229
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/js/dist/server/server.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/js/dist/utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/js/dist/worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/js/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class SandboxServer {
}

get rpcAddr(): string {
return `http://localhost:${this.port}`;
return `http://127.0.0.1:${this.port}`;
}

async start(): Promise<SandboxServer> {
Expand Down
2 changes: 1 addition & 1 deletion packages/js/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function urlConfigFromNetwork(network: string | {network: string; rpcAddr
case 'sandbox':
return {
network: 'sandbox',
rpcAddr: 'http://localhost',
rpcAddr: 'http://127.0.0.1',
};

case 'custom':
Expand Down
4 changes: 2 additions & 2 deletions packages/js/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class SandboxWorker extends Worker {
port,
rm: false,
refDir: null,
rpcAddr: `http://localhost:${port}`,
rpcAddr: `http://127.0.0.1:${port}`,
};
}

Expand All @@ -226,6 +226,6 @@ export class SandboxWorker extends Worker {
}

private get rpcAddr(): string {
return `http://localhost:${this.config.port}`;
return `http://127.0.0.1:${this.config.port}`;
}
}

0 comments on commit 46fb229

Please sign in to comment.