Skip to content

Segaja/http-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published