Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-http-proxy

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-http-proxy - npm Package Compare versions

Comparing version 0.2.2 to 0.3.0

.tern-port

15

index.js

@@ -5,6 +5,6 @@ var assert = require('assert');

var http = require('http');
var https = require('https');
var is = require('type-is');
var getRawBody = require('raw-body');
require('buffer');

@@ -20,2 +20,4 @@

var ishttps = /^https/.test(host);
if (typeof host == 'string') {

@@ -26,6 +28,6 @@ var mc = host.match(/^(https?:\/\/)/);

}
var h = host.split(':');
host = h[0];
port = h[1] || 80;
port = h[1] || (ishttps ? 443 : 80);
}

@@ -83,3 +85,3 @@

var chunks = [];
var realRequest = http.request(reqOpt, function(rsp) {
var realRequest = (ishttps ? https : http).request(reqOpt, function(rsp) {
var rspData = null;

@@ -119,4 +121,5 @@ rsp.on('data', function(chunk) {

});
} else
} else {
res.send(rspData);
}
});

@@ -156,3 +159,3 @@

for (var prop in source) {
if (skips.indexOf(prop) == -1)
if (!skips || skips.indexOf(prop) == -1)
obj[prop] = source[prop];

@@ -159,0 +162,0 @@ }

27

package.json
{
"name": "express-http-proxy",
"version": "0.2.2",
"version": "0.3.0",
"description": "http proxy middleware for express",

@@ -38,18 +38,17 @@ "main": "index.js",

},
"contributors": [
{
"name": "Wei Gao",
"email": "jky239@gmail.com"
},
{
"contributors": [{
"name": "Liam Bennett"
},
{
"name": "Saulius Menkevičius"
},
{
}, {
"name": "eldereal",
"url": "https://github.com/eldereal"
}, {
"name": "Saulius Menkevičius",
"url": "https://github.com/razzmatazz"
}, {
"name": "Jérémy Lal",
"email": "kapouer@melix.org"
}
]
}, {
"name": "Wei Gao",
"email": "jky239@gmail.com"
}]
}

@@ -15,2 +15,16 @@ var assert = require('assert');

describe('test https', function() {
it('https', function(done) {
var https = express();
https.use(proxy('https://httpbin.org'));
request(https)
.get('/user-agent')
.end(function(err, res) {
if (err) return done(err);
assert(res.body);
done();
});
});
});
describe('test intercept & decorateRequest', function() {

@@ -17,0 +31,0 @@ it('decorateRequest', function(done) {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc