Your IP : 216.73.216.17


Current Path : /etc/kibana/node_modules/http-request-to-url/
Upload File :
Current File : //etc/kibana/node_modules/http-request-to-url/index.js

const awaitEvent = require('await-event')
const socketLocation = require('socket-location')

module.exports = async function httpRequestToUrl (request) {
  if (!request.socket) {
    await awaitEvent(request, 'socket')
  }

  const { socket } = request
  const proto = `http${socket.encrypted ? 's' : ''}:`
  const location = await socketLocation(socket)

  return `${proto}//${location}${request.path}`
}