Skip to content

Commit

Permalink
pulling hostname from the authority header
Browse files Browse the repository at this point in the history
Fix for #79
  • Loading branch information
nitinhayaran committed Feb 9, 2018
1 parent 13a8cca commit def2932
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ module.exports = function livereload(opt) {

// middleware
return function livereload(req, res, next) {
var host = opt.hostname || req.headers.host.split(':')[0];
var hostName = req.headers[':authority'] || req.headers.host;
var host = opt.hostname || hostName.split(':')[0];

if (res._livereload) return next();
res._livereload = true;
Expand Down

0 comments on commit def2932

Please sign in to comment.