Permalink
Browse files

[fix] Removed test

  • Loading branch information...
1 parent 460caf4 commit 91583404ddbd2c6720cd27c3871a49321d0b89cb @alejandro alejandro committed Sep 3, 2012
Showing with 14 additions and 8 deletions.
  1. +14 −8 proxy/proxy.js
View
22 proxy/proxy.js
@@ -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) {
@@ -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) {

0 comments on commit 9158340

Please sign in to comment.