Skip to content

Commit 46fb229

Browse files
authored
fix: Use 127.0.0.1 ipv4 instead of localhost to avoid ipv6 conflicts (#200)
1 parent b90f4f6 commit 46fb229

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

packages/js/dist/server/server.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/js/dist/utils.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/js/dist/worker.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/js/src/server/server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class SandboxServer {
131131
}
132132

133133
get rpcAddr(): string {
134-
return `http://localhost:${this.port}`;
134+
return `http://127.0.0.1:${this.port}`;
135135
}
136136

137137
async start(): Promise<SandboxServer> {

packages/js/src/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function urlConfigFromNetwork(network: string | {network: string; rpcAddr
8181
case 'sandbox':
8282
return {
8383
network: 'sandbox',
84-
rpcAddr: 'http://localhost',
84+
rpcAddr: 'http://127.0.0.1',
8585
};
8686

8787
case 'custom':

packages/js/src/worker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export class SandboxWorker extends Worker {
200200
port,
201201
rm: false,
202202
refDir: null,
203-
rpcAddr: `http://localhost:${port}`,
203+
rpcAddr: `http://127.0.0.1:${port}`,
204204
};
205205
}
206206

@@ -226,6 +226,6 @@ export class SandboxWorker extends Worker {
226226
}
227227

228228
private get rpcAddr(): string {
229-
return `http://localhost:${this.config.port}`;
229+
return `http://127.0.0.1:${this.config.port}`;
230230
}
231231
}

0 commit comments

Comments
 (0)