Skip to content

Commit b3efa60

Browse files
authored
feat: add findIp example and remove internalIPSync example
1 parent b550a70 commit b3efa60

4 files changed

Lines changed: 6 additions & 38 deletions

File tree

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# internalIP(family: "v4" | "v6")
1+
# findIp(family: "v4" | "v6")
22

3-
Returns the internal IP address asynchronously.
3+
Returns the internal IP address.
44

55
```js
66
const WebpackDevServer = require("webpack-dev-server");
77

88
const logInternalIPs = async () => {
9-
const localIPv4 = await WebpackDevServer.internalIP("v4");
10-
const localIPv6 = await WebpackDevServer.internalIP("v6");
9+
const localIPv4 = WebpackDevServer.findIp("v4", false);
10+
const localIPv6 = WebpackDevServer.findIp("v6", false);
1111

1212
console.log("Local IPv4 address:", localIPv4);
1313
console.log("Local IPv6 address:", localIPv6);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
const WebpackDevServer = require("../../../lib/Server");
44

55
const logInternalIPs = async () => {
6-
const localIPv4 = await WebpackDevServer.internalIP("v4");
7-
const localIPv6 = await WebpackDevServer.internalIP("v6");
6+
const localIPv4 = WebpackDevServer.findIp("v4", false);
7+
const localIPv6 = WebpackDevServer.findIp("v6", false);
88

99
console.log("Local IPv4 address:", localIPv4);
1010
console.log("Local IPv6 address:", localIPv6);

examples/api/internal-ip-sync/README.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

examples/api/internal-ip-sync/app.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)