fast-proxy
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -15,4 +15,4 @@ 'use strict' | ||
const requests = { | ||
'http:': http, | ||
'https:': https | ||
'http:': opts.requests && opts.requests.http ? opts.requests.http : http, | ||
'https:': opts.requests && opts.requests.https ? opts.requests.https : https | ||
} | ||
@@ -19,0 +19,0 @@ const baseUrl = opts.base |
{ | ||
"name": "fast-proxy", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "Forward your HTTP request to another server.", | ||
"main": "index.js", | ||
"scripts": { | ||
"lint": "npx standard", | ||
"test": "nyc mocha test/*.test.js", | ||
@@ -36,7 +37,8 @@ "bench": "( node benchmark/service.js & node benchmark/fast-proxy-0http-gateway.js & (sleep 5 && wrk -t8 -c8 -d30s http://127.0.0.1:8080/service/hi) )" | ||
"devDependencies": { | ||
"0http": "^2.2.2", | ||
"0http": "^2.2.4", | ||
"body-parser": "^1.19.0", | ||
"chai": "^4.2.0", | ||
"fastify": "^2.13.0", | ||
"fastify-reply-from": "^2.0.1", | ||
"fastify": "^2.13.1", | ||
"fastify-reply-from": "^2.1.0", | ||
"follow-redirects": "^1.11.0", | ||
"h2url": "^0.2.0", | ||
@@ -48,3 +50,3 @@ "http-proxy": "^1.18.0", | ||
"pem": "^1.14.4", | ||
"restana": "^4.3.1", | ||
"restana": "^4.3.2", | ||
"standard": "^14.3.3", | ||
@@ -56,3 +58,3 @@ "supertest": "^4.0.2" | ||
"pump": "^3.0.0", | ||
"semver": "^7.2.1", | ||
"semver": "^7.3.2", | ||
"tiny-lru": "^7.0.2", | ||
@@ -59,0 +61,0 @@ "undici": "^0.5.0" |
@@ -85,2 +85,17 @@ # fast-proxy | ||
#### requests.http and requests.https | ||
Allows to optionally overwrite the internal `http` and `https` client agents implementation. Defaults: [`http`](https://nodejs.org/api/http.html#http_http) and [`https`](https://nodejs.org/api/https.html#https_https). | ||
For example, this could be used to add support for following redirects, like so: | ||
```js | ||
... | ||
requests: { | ||
http: require('follow-redirects/http'), | ||
https: require('follow-redirects/https') | ||
} | ||
... | ||
``` | ||
> If using `undici` or `http2` this settings are ignored! | ||
#### keepAliveMsecs | ||
@@ -87,0 +102,0 @@ Defaults to 1 minute, passed down to [`http.Agent`][http-agent] and |
18024
168
15
Updatedsemver@^7.3.2