dv-browser 3.0.0 → 3.1.1
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/index.js +9 -2
- package/package.json +4 -3
package/index.js
CHANGED
|
@@ -21,6 +21,8 @@ let DvBrowser = function (_config) {
|
|
|
21
21
|
authBasic: null,
|
|
22
22
|
authBearer: null,
|
|
23
23
|
noDeflate: false,
|
|
24
|
+
lowSpeedTimeout: 15,
|
|
25
|
+
contentDecoding: null,
|
|
24
26
|
}, _config);
|
|
25
27
|
|
|
26
28
|
const cookiejar = new CookieJar(null);
|
|
@@ -120,8 +122,10 @@ let DvBrowser = function (_config) {
|
|
|
120
122
|
curl.setOpt(Curl.option.URL, options.url);
|
|
121
123
|
curl.setOpt(Curl.option.TIMEOUT, options.timeout);
|
|
122
124
|
curl.setOpt(Curl.option.CONNECTTIMEOUT, options.connectTimeout);
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
if (options.lowSpeedTimeout) {
|
|
126
|
+
curl.setOpt(Curl.option.LOW_SPEED_TIME, options.lowSpeedTimeout);
|
|
127
|
+
curl.setOpt(Curl.option.LOW_SPEED_LIMIT, 512);
|
|
128
|
+
}
|
|
125
129
|
curl.setOpt(Curl.option.NOPROGRESS, true);
|
|
126
130
|
curl.setOpt(Curl.option.HTTPHEADER, headers);
|
|
127
131
|
// curl.setOpt(Curl.option.VERBOSE, true);
|
|
@@ -136,6 +140,9 @@ let DvBrowser = function (_config) {
|
|
|
136
140
|
if (!options.noDeflate) {
|
|
137
141
|
curl.setOpt(Curl.option.ACCEPT_ENCODING, 'gzip');
|
|
138
142
|
}
|
|
143
|
+
if (options.contentDecoding !== null) {
|
|
144
|
+
curl.setOpt(Curl.option.HTTP_CONTENT_DECODING, options.contentDecoding);
|
|
145
|
+
}
|
|
139
146
|
if (options?.httpProxy?.address && options?.httpProxy?.port) {
|
|
140
147
|
curl.setOpt(Curl.option.PROXY, options.httpProxy.address + ':' + options.httpProxy.port);
|
|
141
148
|
if (options.httpProxy.auth) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dv-browser",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/druidvav/node-browser",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"node-libcurl": "
|
|
20
|
+
"node-libcurl": "4.0.0",
|
|
21
21
|
"tough-cookie": "4.1.3"
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
|
+
"packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
|
|
23
24
|
}
|