Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[fix] Attempt No1 to fix socket.io issues

  • Loading branch information...
commit a27ec8b9276916a3b976d369a84542217aba3133 1 parent 8490462
@alejandro alejandro authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 proxy/proxy.js
View
6 proxy/proxy.js
@@ -34,13 +34,14 @@ fs.watchFile(config.opt.proxy_table_file, function (oldts, newts) {
log.info('Proxy map failed to update! (read)')
throw err;
} else {
+ var old = JSON.parse(JSON.stringify(proxymap));
try {
proxymap = JSON.parse(data);
log.info('Proxy map updated')
} catch(e){
log.warn(e)
+ proxymap = old;
}
-
}
});
});
@@ -82,8 +83,9 @@ bouncy(function (req, bounce) {
var host = req.headers.host.replace(/:\d+$/, '');
var route = proxymap[host] || proxymap[''];
// log only urls that are not media files like public folders, css,js
- if (!path.extname(req.url))
+ if (!path.extname(req.url)) {
log.info(host + ':' + route);
+ }
req.on('error', function (err) {
var res = bounce.respond();
res.statusCode = 500;
Please sign in to comment.
Something went wrong with that request. Please try again.