zgrzyt 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/check.js +5 -4
- package/package.json +10 -5
package/lib/check.js
CHANGED
|
@@ -35,7 +35,7 @@ async function checkService(server, api) {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
async function checkApi({ url, timeout, method = 'HEAD', headers = {}, retry = 2 }, address) {
|
|
38
|
+
async function checkApi({ url, timeout, method = 'HEAD', headers = {}, retry = 2, family = 4 }, address) {
|
|
39
39
|
debug('Checking %s on %s with timeout %dms', url, address, timeout);
|
|
40
40
|
|
|
41
41
|
const { protocol } = new URL(url);
|
|
@@ -55,7 +55,8 @@ async function checkApi({ url, timeout, method = 'HEAD', headers = {}, retry = 2
|
|
|
55
55
|
function makeRequest() {
|
|
56
56
|
return new Promise(resolve => request(url, {
|
|
57
57
|
method,
|
|
58
|
-
|
|
58
|
+
family,
|
|
59
|
+
lookup,
|
|
59
60
|
timeout,
|
|
60
61
|
headers: {
|
|
61
62
|
'User-Agent': USER_AGENT,
|
|
@@ -80,8 +81,8 @@ async function checkApi({ url, timeout, method = 'HEAD', headers = {}, retry = 2
|
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
function
|
|
84
|
-
|
|
84
|
+
function lookup(domain, options, fn) {
|
|
85
|
+
fn(null, address, family);
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zgrzyt",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Poor man's load balancing DNS switcher.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -8,8 +8,13 @@
|
|
|
8
8
|
"email": "pirxpilot@furkot.com",
|
|
9
9
|
"url": "https://pirxpilot.me"
|
|
10
10
|
},
|
|
11
|
-
"repository":
|
|
12
|
-
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/pirxpilot/zgrzyt.git"
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"zgrzyt": "bin/zgrzyt.cjs"
|
|
17
|
+
},
|
|
13
18
|
"license": "MIT",
|
|
14
19
|
"keywords": [
|
|
15
20
|
"zgrzyt",
|
|
@@ -22,13 +27,13 @@
|
|
|
22
27
|
},
|
|
23
28
|
"dependencies": {
|
|
24
29
|
"debug": "~4",
|
|
25
|
-
"got": "~
|
|
30
|
+
"got": "~13",
|
|
26
31
|
"parse-domain": "~7",
|
|
27
32
|
"rc": "^1.2.8",
|
|
28
33
|
"sprintfjs": "^1.2.16"
|
|
29
34
|
},
|
|
30
35
|
"devDependencies": {
|
|
31
|
-
"jshint": "^
|
|
36
|
+
"@pirxpilot/jshint": "^3.0.0"
|
|
32
37
|
},
|
|
33
38
|
"scripts": {
|
|
34
39
|
"test": "make check"
|