Added config option to enable/disable logging
parent
fe806d2d7b
commit
9a6293018a
|
@ -1,4 +1,5 @@
|
||||||
exports.port = process.env.PORT || 3000;
|
exports.port = process.env.PORT || 3000;
|
||||||
|
exports.enable_logging = false;
|
||||||
exports.fetch_regex = /^\/fetch\/(.*)$/; // The URL to look for when parsing the request.
|
exports.fetch_regex = /^\/fetch\/(.*)$/; // The URL to look for when parsing the request.
|
||||||
exports.proxy_request_timeout_ms = 10000; // The lenght of time we'll wait for a proxy server to respond before timing out.
|
exports.proxy_request_timeout_ms = 10000; // The lenght of time we'll wait for a proxy server to respond before timing out.
|
||||||
exports.max_request_length = 100000; // The maximum length of characters allowed for a request or a response.
|
exports.max_request_length = 100000; // The maximum length of characters allowed for a request or a response.
|
||||||
|
|
|
@ -120,7 +120,10 @@ http.createServer(function (req, res) {
|
||||||
var remoteIP = getClientAddress(req);
|
var remoteIP = getClientAddress(req);
|
||||||
|
|
||||||
// Log our request
|
// Log our request
|
||||||
|
if(config.enable_logging)
|
||||||
|
{
|
||||||
console.log("%s %s %s", (new Date()).toJSON(), remoteIP, req.method, req.url);
|
console.log("%s %s %s", (new Date()).toJSON(), remoteIP, req.method, req.url);
|
||||||
|
}
|
||||||
|
|
||||||
if(config.enable_rate_limiting)
|
if(config.enable_rate_limiting)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue