Created
July 26, 2011 15:37
-
-
Save tralamazza/1107045 to your computer and use it in GitHub Desktop.
(http - https) proxy rapleaf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'), | |
httpProxy = require('http-proxy'); | |
var proxy = new httpProxy.HttpProxy(); | |
proxy.on('proxyError', function(err, req, res) { | |
console.log('proxy.error: ' + err); | |
}); | |
proxy.on('end', function(req, res) { | |
console.log('proxy.end'); | |
}); | |
http.createServer(function(req, res) { | |
proxy.proxyRequest(req, res, { | |
host: 'personalize.rapleaf.com', | |
port: 443, | |
https: true | |
}); | |
}).listen(8000); |
Strangely if you submit the request directly
curl -v "https://personalize.rapleaf.com/v4/dr?first=John&last=Doe&email=personalize%40example.com&api_key=78ad9ddc21e3c220cc5da024b6dbe13"
the Content-Length is present.
thats a clue! so it sounds like nhp is removing the Content-Length header.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ curl -v "http://localhost:8000/v4/dr?first=John&last=Doe&email=personalize%40example.com&api_key=78ad9ddc21e3c220cc5da024b6dbe13"