Fixup control request handling for absent cameras

This commit is contained in:
Christian Franke 2014-02-04 01:28:53 +01:00
parent 78e9d025cf
commit ff8bc55750
1 changed files with 10 additions and 1 deletions

View File

@ -32,7 +32,16 @@ function SimpleProxy(url) {
self.url = url;
self.handle_request = function(req, res) {
request(self.url).pipe(res);
request(self.url, function(err, response, body) {
if (err) {
console.log("Simple proxy " + self.url + " failed.");
console.log(err);
res.end();
return;
}
res.write(body);
res.end();
});
};
}