nopox

0.1.1 • Public • Published

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

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);

Readme

Keywords

Package Sidebar

Install

npm i nopox

Weekly Downloads

2

Version

0.1.1

License

MIT

Last publish

Collaborators

  • zetxx