Skip to content

Commit 58b5fd2

Browse files
authored
fea!t: remove internalIP methods (#121)
1 parent f13a2d2 commit 58b5fd2

3 files changed

Lines changed: 7 additions & 17 deletions

File tree

src/server.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -302,16 +302,6 @@ class Server<
302302
}
303303
}
304304

305-
// TODO remove me in the next major release, we have `findIp`
306-
static async internalIP(family: 'v4' | 'v6') {
307-
return Server.findIp(family, false);
308-
}
309-
310-
// TODO remove me in the next major release, we have `findIp`
311-
static internalIPSync(family: 'v4' | 'v6') {
312-
return Server.findIp(family, false);
313-
}
314-
315305
static async getHostname(hostname: Host) {
316306
if (hostname === 'local-ip') {
317307
return (

tests/e2e/allowed-hosts.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ describe('allowed hosts', () => {
16831683
});
16841684

16851685
it('should always allow value from the `host` options if options.allowedHosts is auto', async () => {
1686-
const networkIP = Server.internalIPSync('v4');
1686+
const networkIP = Server.findIp('v4', false);
16871687
const options = {
16881688
host: networkIP,
16891689
allowedHosts: 'auto',

tests/e2e/web-socket-server-url.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe('web socket server URL', () => {
111111
it(`should work behind proxy, when hostnames are different and ports are same ("${webSocketServer}")`, async () => {
112112
const devServerHost = '127.0.0.1';
113113
const devServerPort = port1;
114-
const proxyHost = Server.internalIPSync('v4');
114+
const proxyHost = Server.findIp('v4', false);
115115
const proxyPort = port1;
116116

117117
const compiler = rspack(config);
@@ -207,7 +207,7 @@ describe('web socket server URL', () => {
207207
it(`should work behind proxy, when hostnames are different and ports are different ("${webSocketServer}")`, async () => {
208208
const devServerHost = '127.0.0.1';
209209
const devServerPort = port1;
210-
const proxyHost = Server.internalIPSync('v4');
210+
const proxyHost = Server.findIp('v4', false);
211211
const proxyPort = port2;
212212

213213
const compiler = rspack(config);
@@ -308,7 +308,7 @@ describe('web socket server URL', () => {
308308
it(`should work behind proxy, when the "host" option is "local-ip" and the "port" option is "auto" ("${webSocketServer}")`, async () => {
309309
process.env.RSPACK_DEV_SERVER_BASE_PORT = 40000;
310310

311-
const proxyHost = Server.internalIPSync('v4');
311+
const proxyHost = Server.findIp('v4', false);
312312
const proxyPort = port2;
313313

314314
const compiler = rspack(config);
@@ -1916,7 +1916,7 @@ describe('web socket server URL', () => {
19161916
});
19171917

19181918
it(`should work when "host" option is IPv4 ("${webSocketServer}")`, async () => {
1919-
const hostname = Server.internalIPSync('v4');
1919+
const hostname = Server.findIp('v4', false);
19201920
const compiler = rspack(config);
19211921
const devServerOptions = {
19221922
webSocketServer,
@@ -1984,7 +1984,7 @@ describe('web socket server URL', () => {
19841984
});
19851985

19861986
it(`should work when "host" option is "local-ip" ("${webSocketServer}")`, async () => {
1987-
const hostname = Server.internalIPSync('v4');
1987+
const hostname = Server.findIp('v4', false);
19881988
const compiler = rspack(config);
19891989
const devServerOptions = {
19901990
webSocketServer,
@@ -2053,7 +2053,7 @@ describe('web socket server URL', () => {
20532053
});
20542054

20552055
it(`should work when "host" option is "local-ipv4" ("${webSocketServer}")`, async () => {
2056-
const hostname = Server.internalIPSync('v4');
2056+
const hostname = Server.findIp('v4', false);
20572057
const compiler = rspack(config);
20582058
const devServerOptions = {
20592059
webSocketServer,

0 commit comments

Comments
 (0)