Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oeo/mirror2
proxy and mitm modify any amount of remote hosts (even with ssl) using harmon modifiers
https://github.com/oeo/mirror2
mitm proxy
Last synced: about 1 month ago
JSON representation
proxy and mitm modify any amount of remote hosts (even with ssl) using harmon modifiers
- Host: GitHub
- URL: https://github.com/oeo/mirror2
- Owner: oeo
- Created: 2016-06-03T21:28:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-13T21:40:40.000Z (about 2 years ago)
- Last Synced: 2024-11-07T18:54:18.666Z (about 2 months ago)
- Topics: mitm, proxy
- Language: CoffeeScript
- Homepage: https://www.npmjs.com/package/mirror2
- Size: 178 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mirror2
`mirror2` is designed to reverse proxy and "mitm" modify remote hosts. it
supports custom connect middlewares at both the routing-level and the
individual host level as well as sync string transforms and harmon select
modifiers._magic mirror on the wall, who is the fairest one of all?_
# quick start
```
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`
# usage
``` 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('', '(mirror2) ');
})
]
},'proxy.com': {
host: 'greatist.com',
enable_ssl: false,// html head appendage for text/html
append_head: "alert('greatist.com')",html_modifiers: [
(function(x) {
return x.replace('', '(mirror2) ');
})
]
}}
});server.setup(function() {
server.listen(7777);
return console.log(":7777");
});
```## new mirror.ProxyManager(options={})
### events
#### proxy_man.on('proxy_spawned',cb)
#### proxy_man.on('proxy_manager_listening',cb)
#### proxy_man.on('request',cb)
#### proxy_man.on('request_ignored',cb)
#### proxy_man.on('request_delivered',cb)
#### proxy_man.on('error',cb)## new mirror.Proxy(options={})
### events
#### proxy.on('proxy_listening',cb)
#### proxy.on('request',cb)
#### proxy.on('request_delivered',cb)
#### proxy.on('error',cb)