Hugo: Handle ngrok vs livereload

Created on 13 Sep 2017  路  7Comments  路  Source: gohugoio/hugo

Using ngrok with livereload and Hugo is pretty cool, but right now the port handling does not support that.

I have tested with just hard coding 443 in the livereload handler setup, and that works. We should think about how to do this properly.

Suggestions welcome.

  • We have appendPort which can be used to remove 1313 from the URL (but it does not remove from the livereload interaction)
  • We have port, but that is the listener port

@digitalcraftsman @moorereason suggestions?

https://ngrok.com/

Enhancement

Most helpful comment

Thinking out loud I think that making appendPort also work for the livereload URL would solve this.

I put this in the 0.28 release because I kind of need this myself, so a quick feedback in the form of "yea, that sounds good" would be nice.

All 7 comments

I'm experiencing the same problem with a local HTTPS proxy in front of hugo.

I have started the dev server with hugo server -b https://mysite.dev/ --appendPort=false and the pages load and navigation via the proxy is fine, but livereload is appending the port which can be seen in the js console error:

WebSocket connection to 'wss://mysite.dev:64871/livereload' failed: Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR

I would expect the websocket URL in this case to be to be wss://mysite.dev/livereload

Thinking out loud I think that making appendPort also work for the livereload URL would solve this.

I put this in the 0.28 release because I kind of need this myself, so a quick feedback in the form of "yea, that sounds good" would be nice.

Yep, I would expect the --appendPort=false flag to not append the port for the livereload websocket URL.

This actually looks like a regression bug looking at some older issues like https://github.com/gohugoio/hugo/issues/1406

Yea, I think the port was added at some point -- which kind of solved one problem, but broke another. Let us just call it an Enhancement, to boost my motivation for fixing it, and it looks better in the release notes ...

Give me a shout if/when you want me to test it out.

@moomerman I have committed a fix for this. My original plan just didn't work, so I added a new flag.

@bep thanks very much! can confirm this works perfectly with a local HTTPS proxy - also didn't know about the --navigateToChanged flag which is very handy 馃槃

Have only been using hugo for a couple of days but very happy with what I've been able to produce with it, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

artelse picture artelse  路  3Comments

kaushalmodi picture kaushalmodi  路  3Comments

vielmetti picture vielmetti  路  3Comments

digitalcraftsman picture digitalcraftsman  路  3Comments

marekr picture marekr  路  3Comments