http-proxy-404
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "http-proxy-404", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,2 +10,3 @@ const express = require('express'); | ||
var app = express(); | ||
const regHttps = /^https/; | ||
const httpAgent = new http.Agent({ | ||
@@ -64,7 +65,8 @@ rejectUnauthorized: false, | ||
while(i<this.options.targetList.length) { | ||
var isHttps = regHttps.test(this.options.targetList[i]) | ||
let result = await axios({ | ||
url: this.options.targetList[i] + req.url, | ||
method: req.method, | ||
httpAgent: httpAgent, | ||
httpsAgent: httpsAgent | ||
httpAgent: isHttps ? httpAgent : null, | ||
httpsAgent: isHttps ? httpsAgent : null | ||
}) | ||
@@ -71,0 +73,0 @@ if (result !== 404) { |
5903
80