cors-proxy-with-https
Advanced tools
Comparing version 1.0.19 to 1.0.20
@@ -34,17 +34,26 @@ const https = require('https') | ||
const server = https.createServer(this.serverOptions, (req, res) => { | ||
if (req.method === 'OPTIONS') { | ||
res.setHeader('Access-Control-Allow-Origin', '*') | ||
res.setHeader('Access-Control-Allow-Headers', '*') | ||
res.setHeader('Access-Control-Allow-Methods', '*') | ||
res.end() | ||
return | ||
} | ||
this.proxy.web(req, res, { | ||
target: this.config.target, | ||
secure: true | ||
const server = httpProxy.createServer({ | ||
changeOrigin: true, | ||
target: this.config.target, | ||
agent: new https.Agent({ | ||
port: 443, | ||
...this.serverOptions | ||
}) | ||
}) | ||
}).listen(8080); | ||
// const server = https.createServer(this.serverOptions, (req, res) => { | ||
// if (req.method === 'OPTIONS') { | ||
// res.setHeader('Access-Control-Allow-Origin', '*') | ||
// res.setHeader('Access-Control-Allow-Headers', '*') | ||
// res.setHeader('Access-Control-Allow-Methods', '*') | ||
// res.end() | ||
// return | ||
// } | ||
// | ||
// this.proxy.web(req, res, { | ||
// target: this.config.target, | ||
// secure: true | ||
// }) | ||
// }) | ||
server.listen(this.config.port, this.config.host) | ||
@@ -51,0 +60,0 @@ } |
{ | ||
"name": "cors-proxy-with-https", | ||
"description": "Прокси для обхода CORS + поддержка HTTPS by devmkru", | ||
"version": "1.0.19", | ||
"version": "1.0.20", | ||
"main": "./lib", | ||
@@ -6,0 +6,0 @@ "bin": { |
5342
93