Created by: AydinChavez
Add method parameter to options for overriding the proxy-outgoing HTTP-method.
Simple solution for issue: https://github.com/nodejitsu/node-http-proxy/issues/1066
Example usage:
var server = http.createServer(function(req, res) {
// You can define here your custom logic to handle the request
// and then proxy the request.
proxy.web(req, res, { target: 'http://127.0.0.1:9200', method: 'GET' });
console.log("req: " + req);
console.log("res: " + res);
});
You could also wrap it into a conditional statement like:
if ( req.method == "POST" ) {
proxy.web ...
}