Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zetxx/nopox
simple proxy
https://github.com/zetxx/nopox
Last synced: 3 months ago
JSON representation
simple proxy
- Host: GitHub
- URL: https://github.com/zetxx/nopox
- Owner: zetxx
- Created: 2014-05-15T20:54:37.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-15T16:28:28.000Z (over 9 years ago)
- Last Synced: 2024-04-28T05:11:52.951Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 336 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A proxy like app for nodejs.
since 0.0.12 its rewritten from scratch without backward compatibility.
It is written for testing purpose only, for simple req response, as transparent proxy
WARNING: port `65001` is for internal use, if you connect to localhost:65001 you will see some statistics
example
```javascript
var nopox = require('nopox');var config = {
"remoteHost":'example.com',
"remotePort":80,//bind to remote port
"localPort":8124,//bind to local port
"listenAddr":'127.0.0.1',//bind to local addr
"connRetryTimeout":5000,//connect retry timeout(ms), defaults to 30000
"logger":function(data){console.log(data.toString());},
"beforeOut":function(data, cb){
console.log('before out, timeouts 1.5 sec');
setTimeout(function(){
cb(data);
}, 1500);
},
"beforeIn":function(data, cb){
console.log('before in, timeouts 5.5 sec');
setTimeout(function(){
cb(data);
}, 5500);
}
};
var proxy = nopox(config);
```