Socket
Socket
Sign inDemoInstall

cors-proxy-with-https

Package Overview
Dependencies
20
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.23 to 1.0.24

37

lib/index.js

@@ -32,14 +32,5 @@ const https = require('https')

res.setHeader('Access-Control-Allow-Origin', '*')
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS');
})
const server = httpProxy.createServer({
changeOrigin: true,
target: this.config.target,
agent: new https.Agent({
port: 443,
...this.serverOptions
})
}, (req, res, proxy) => {
const server = httpProxy.createServer(this.serverOptions, (req, res) => {
if (req.method === 'OPTIONS') {

@@ -50,31 +41,11 @@ res.setHeader('Access-Control-Allow-Origin', '*')

res.end()
return;
return
}
proxy.on('proxyRes', function(proxyRes, req, res) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS');
});
proxy.web(req, res, {
this.proxy.web(req, res, {
target: this.config.target,
secure: true
})
});
})
// 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)

@@ -81,0 +52,0 @@ }

2

package.json
{
"name": "cors-proxy-with-https",
"description": "Прокси для обхода CORS + поддержка HTTPS by devmkru",
"version": "1.0.23",
"version": "1.0.24",
"main": "./lib",

@@ -6,0 +6,0 @@ "bin": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc