Skip to content

Commit 7ba16cd

Browse files
authored
Changed default ip for dev to * (#3733)
1 parent d72722f commit 7ba16cd

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

.changeset/shiny-rats-hide.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Change local dev server default ip to `*` instead of `0.0.0.0`. This will cause the dev server to listen on both ipv4 and ipv6 interfaces

packages/wrangler/src/__tests__/configuration.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe("normalizeAndValidateConfig()", () => {
2828
d1_databases: [],
2929
constellation: [],
3030
dev: {
31-
ip: "0.0.0.0",
31+
ip: "*",
3232
local_protocol: "http",
3333
port: undefined, // the default of 8787 is set at runtime
3434
upstream_protocol: "https",

packages/wrangler/src/__tests__/dev.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -835,13 +835,13 @@ describe("wrangler dev", () => {
835835
});
836836

837837
describe("ip", () => {
838-
it("should default ip to 0.0.0.0", async () => {
838+
it("should default ip to *", async () => {
839839
writeWranglerToml({
840840
main: "index.js",
841841
});
842842
fs.writeFileSync("index.js", `export default {};`);
843843
await runWrangler("dev");
844-
expect((Dev as jest.Mock).mock.calls[0][0].initialIp).toEqual("0.0.0.0");
844+
expect((Dev as jest.Mock).mock.calls[0][0].initialIp).toEqual("*");
845845
expect(std.out).toMatchInlineSnapshot(`""`);
846846
expect(std.warn).toMatchInlineSnapshot(`""`);
847847
expect(std.err).toMatchInlineSnapshot(`""`);
@@ -1057,7 +1057,7 @@ describe("wrangler dev", () => {
10571057
});
10581058
fs.writeFileSync("index.js", `export default {};`);
10591059
await runWrangler("dev");
1060-
expect((Dev as jest.Mock).mock.calls[0][0].initialIp).toEqual("0.0.0.0");
1060+
expect((Dev as jest.Mock).mock.calls[0][0].initialIp).toEqual("*");
10611061
expect(std.out).toMatchInlineSnapshot(`
10621062
"Your worker has access to the following bindings:
10631063
- Durable Objects:

packages/wrangler/src/config/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export interface DevConfig {
187187
/**
188188
* IP address for the local dev server to listen on,
189189
*
190-
* @default `0.0.0.0`
190+
* @default `*`
191191
*/
192192
ip: string;
193193

packages/wrangler/src/config/validation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ function normalizeAndValidateDev(
392392
rawDev: RawDevConfig
393393
): DevConfig {
394394
const {
395-
ip = "0.0.0.0",
395+
ip = "*",
396396
port,
397397
inspector_port,
398398
local_protocol = "http",

0 commit comments

Comments
 (0)