Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[fix] Removed test
  • Loading branch information
alejandro committed Sep 3, 2012
1 parent 460caf4 commit 9158340
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions proxy/proxy.js
Expand Up @@ -28,7 +28,7 @@ var proxymap = {
};

// Avoid DDOS
var bannedIPs = ['212.44.42.5'];
var bannedIPs = [];

// Ghetto hack for error page
var getErrorPage = function (title, code, error) {
Expand Down Expand Up @@ -57,20 +57,26 @@ fs.watchFile(config.opt.proxy_table_file, function (oldts, newts) {
});
});

fs.watchFile(__dirname + '/ips.json', function(oldts, newts){
fs.readFile(__dirname + '/ips.json', function(err, data){
function readIP (){
return fs.readFile(__dirname + '/ips.json', function(err, data){
if (err) {
log.info('Can\'t load the ips (read)');
} else {
try {
bannedIPs = JSON.parse(data)
log.info('ips updated')
bannedIPs = JSON.parse(data);
log.info('ips updated');
} catch (exc) {
log.warn(exc)
log.warn(exc);
}
}
})
})
});
}

fs.watchFile(__dirname + '/ips.json', function(oldts, newts){
return readIP();
});

readIP();

//Don't crash br0
process.on('uncaughtException', function (err) {
Expand Down

0 comments on commit 9158340

Please sign in to comment.