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

@param {ExpressRequest} req
@param {String} origin
Create window . location - like object from express request