diff options
author | Christian Franke <nobody@nowhere.ws> | 2014-02-04 01:28:53 +0100 |
---|---|---|
committer | Christian Franke <nobody@nowhere.ws> | 2014-02-04 01:28:53 +0100 |
commit | ff8bc5575082e08d5b8232bb61740308a36afa6a (patch) | |
tree | 9ec2083e5ab2dbe2ce105e688fe4fb3973c41c0a | |
parent | 78e9d025cfcb958c484eef2074604f88fc52f983 (diff) |
Fixup control request handling for absent cameras
-rw-r--r-- | server.js | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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(); + }); }; } |