Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.66 KB

README.md

File metadata and controls

50 lines (34 loc) · 1.66 KB

HTTP Proxy

Setup

npm install

Copy config.js.default to config.js and modify to the desired values

Run

node http-proxy.js

Configure

module.exports = {
    ip: 'proxy.example.com',           // this is what the
    port: 80,                          // proxy will listen to

    sourceServer: 'somehost.com',      // this is what the proxy
    sourcePort: 80,                    // will read from

    sourceTimeout: 2000,               // timeout for requests
                                       // to source (ms)

    log: {                             // logging:

        file: './http-proxy.log',      // set to null to not use
                                       // file logging

        console: true,                 // set to false to not
                                       // log to stdout

        level: 0,                      // 0: error, 1: warnings
                                       // 2: notices, 3: debug

        debugKeys: [                   // Empty Array: log all debug

            'Request',                 // Special keys to be debugged
            'CacheSize',               // ^^
            'GarbageCollection'        // ^^
        ]
    },
    cacheSize: 100,                    // Number of resources
                                       // to be cached before
                                       // evictions will occure

    garbageCollectionInterval: 1000    // intervall with that the
                                       // garbage collection will evict
                                       // entries
};