js-proxy

    0.0.6 • Public • Published

    JS-Proxy

    A multithreaded man-in-the-middle proxy which captures JavaScript on the fly and lets you modify it using a callback.

    Installation

    npm install js-proxy
    

    The callback function is called for each node returned by falafel

    var proxy = require('js-proxy');
     
    var options = {};
    options.port = 9003;
    options.threads = 3;
    options.preprocess = function(input){
         // add in your preprocessing logic here
         return input;
    };
    options.postprocess = function(input){
         // add in your postprocessing logic here
         return input;
    };
    options.instrument = function(node) {
        if(node.type == "Program") {
        node.update("'use strict;';\n" + node.source());
        }
    }
     
    proxy.start(options);

    Install

    npm i js-proxy

    DownloadsWeekly Downloads

    18

    Version

    0.0.6

    License

    MIT

    Last publish

    Collaborators

    • inian