🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
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

to
0.5.0

6

index.js

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

var h = host.split(':');
if (h[1] === '443') {
ishttps = true;
}
host = h[0];

@@ -33,3 +37,5 @@ port = h[1] || (ishttps ? 443 : 80);

port = options.port || port;
/**

@@ -36,0 +42,0 @@ * intercept(targetResponse, data, res, req, function(err, json));

2

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

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -23,2 +23,33 @@ var assert = require('assert');

if (err) return done(err);
assert(res.body['user-agent']);
done();
});
});
it('https port 443', function(done) {
var https = express();
https.use(proxy('httpbin.org:443'));
request(https)
.get('/user-agent')
.end(function(err, res) {
if (err) return done(err);
done();
});
});
});
describe('test different port', function() {
it('port', function(done) {
var http = express();
var other = express();
other.get('/', function(req, res) {
res.send('Hello World!');
});
other.listen(8080);
http.use(proxy('http://localhost', {
port: 8080
}));
request(http)
.get('/')
.end(function(err, res) {
if (err) return done(err);
assert(res.body);

@@ -25,0 +56,0 @@ done();