Merge pull request #119 from kode54/master

Two minor fixes (connection rate limiting, default http index mime type)
This commit is contained in:
Mattias Erming 2014-09-13 12:14:45 +02:00
commit ca08753d3b
2 changed files with 10 additions and 1 deletions

View File

@ -54,8 +54,15 @@ function Client(sockets, config) {
}); });
if (config) { if (config) {
var client = this; var client = this;
var wait_total = 0;
_.each(config.networks || [], function(n) { _.each(config.networks || [], function(n) {
if (wait_total == 0)
client.connect(n); client.connect(n);
else
setTimeout(function() {
client.connect(n);
}, wait_total);
wait_total += 500;
}); });
} }
} }

View File

@ -47,6 +47,8 @@ function index(req, res, next) {
require("../package.json"), require("../package.json"),
config config
); );
res.setHeader("Content-Type", "text/html");
res.writeHead(200);
res.end(_.template( res.end(_.template(
file, file,
data data