Having tried http-proxy using node.js, I have the following code snippet:
var httpProxy = require('http-proxy'); httpProxy.createServer( require('proxy-by-url')({ '/AAA': { port: 80, host: 'myDomain.com' }, '/BBB': { port: 80, host: 'myDomain.com' } }) ).listen(8000);
Obviously, all requests to http://localhost:8000/AAA and http://localhost:8000/BBB proxied to http://myDomain.com
I am trying to proxy http://localhost:8000/AAA requests to http://myDomain.com/AAA/rss.xml but cannot figure out how to install this.
I tried:
'/AAA': { port: 80, host: 'myDomain.com/AAA/rss.xml' }
but he throws exceptions.
'/AAA': { port: 80, host: 'myDomain.com', url: '/AAA/rss.xml' }
or
'/AAA': { port: 80, host: 'myDomain.com', path: '/AAA/rss.xml' }
are ineffective.
Does anyone have an idea on how to install this?
source share