code: function installHandler(deviceRootUrl) {
    deviceUrl = url.parse(deviceRootUrl);
    //do we need to handle https device root Url?
    if (deviceUrl.protocol !== 'http:') {
      console.error('do not support non-http device url');
      return;
    }
    // TODO: in real production this must be hosted on https
    app.use('/', function(req, res) {
      var parsedUrl = url.parse(req.url);
      var headersCopy = {};
      // create a copy of request headers
      for (attr in req.headers) {
        if (!req.headers.hasOwnProperty(attr)) continue;
        headersCopy[attr] = req.headers[attr];
      }
      deviceUrl.path = req.url;
      var options = {
        uri: deviceUrl,
        method: req.method,
        path: parsedUrl.path,
        headers: headersCopy
      };
  
      var clientRequest = request(options);
      clientRequest.on('response', function(response) {
        res.statusCode = response.statusCode;
        for (header in response.headers) {
          if (!response.headers.hasOwnProperty(header)) continue;
          res.setHeader(header, response.headers[header]);
        }
        response.pipe(res);
      });
      req.pipe(clientRequest);
    });
  }
docs: TODO: do token based auth for both http and ws server because this is for ONVIF device which requires token auth