code: function makeLocation(req, origin) {
    var protocol = !!req.connection.verifyPeer ? 'https://' : 'http://',
        reqOrigin = origin || (protocol + req.headers.host);
    return url.parse(reqOrigin + req.originalUrl);
  }
docs: Create window.location-like object from express request
  
  @param {ExpressRequest} req
  @param {String} origin