I'm trying to get a very simple proxy working with node-http-proxy which I would expect to just return the contents of google:
const http = require('http');
const httpProxy = require('http-proxy');
const targetUrl = 'http://www.google.co.uk';
const proxy = httpProxy.createProxyServer({
target: targetUrl
});
http.createServer(function (req, res) {
proxy.web(req, res);
}).listen(6622);
For example I would expect http://localhost:6622/images/nav_logo242.png to proxy to http://www.google.co.uk/images/nav_logo242.png instead of returning a 404 not found.
Thanks.