Reputation: 3382
Currently I have got a simple proxy set up with Apache:
ProxyPass /ext/ https://ext.a-nice-url.at/
ProxyPassReverse /ext/ https://ext.a-nice-url.at
It is working fine, but in order to make it easier for others to install I was thinking to make a little server in nodejs. This Server will just be used for developers and testers, so it must not be very huge.
I was already searching on google a bit and found http-proxy, but I am not sure how to use that properly. Any suggestions how I can make that?
Upvotes: 4
Views: 1888
Reputation: 3382
I got it working with a simple express application as you can see below:
var express = require('express');
var request = require('request');
var app = express();
app.use('/ext/', function(req, res) {
var url = 'https://ext.a-nice-url.at/' + req.url;
var options = {
url: url,
rejectUnauthorized: false
}
req.pipe(request(url)).pipe(res);
});
Upvotes: 4