Skip to content

Commit 6e58756

Browse files
Apollon77joeferner
authored andcommitted
make sure we use ipv4 first lookup for testing because we start server on 127.0.0.1
1 parent bafad38 commit 6e58756

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/01_proxy.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import http from "http";
77
import net from "net";
88
import nodeStatic from "node-static";
99
import WebSocket from "ws";
10-
import { Proxy } from "../lib/proxy";
10+
import { Proxy } from "../";
11+
import dns from "dns";
1112

1213
const fileStaticA = new nodeStatic.Server(`${__dirname}/wwwA`);
1314
const fileStaticB = new nodeStatic.Server(`${__dirname}/wwwB`);
@@ -19,6 +20,10 @@ const testWSPort = 40007;
1920
const testUrlA = `http://${testHost}:${testPortA}`;
2021
const testUrlB = `http://${testHost}:${testPortB}`;
2122

23+
if (typeof dns.setDefaultResultOrder === "function") {
24+
dns.setDefaultResultOrder("ipv4first");
25+
}
26+
2227
const getHttp = (url, cb) => {
2328
request({ url }, (err, resp, body) => {
2429
cb(err, resp, body);

0 commit comments

Comments
 (0)