a serious series of tubes
npm install mirror2mirror2 is designed to reverse proxy and "mitm" modify remote hosts. it_magic mirror on the wall, who is the fairest one of all?_
```
git clone https://github.com/tosadvisor/mirror2
cd mirror2
npm i
node usage.js
optionally, for demo purposes
echo "127.0.0.1 proxy.com" >> /etc/hosts
open browser to http://localhost:7777
` javascript
var mirror, server;
mirror = require('mirror2');
server = new mirror.ProxyManager({
hosts: {
'localhost': {
// remote host to mirror
host: 'stackoverflow.com',
// enable ssl for connection to remote host
enable_ssl: true,
// synchronous source modifiers for text/html
html_modifiers: [
(function(x) {
return x.replace('
'proxy.com': {
host: 'greatist.com',
enable_ssl: false,
// html head appendage for text/html
append_head: "",
html_modifiers: [
(function(x) {
return x.replace('
}
});
server.setup(function() {
server.listen(7777);
return console.log(":7777");
});
``
