express-http-proxy
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -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)); |
{ | ||
"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(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15620
355