Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPS support #143

Open
rupurt opened this issue Sep 10, 2015 · 12 comments
Open

HTTPS support #143

rupurt opened this issue Sep 10, 2015 · 12 comments

Comments

@rupurt
Copy link

rupurt commented Sep 10, 2015

Hi,

Do you have any plans to add HTTPS support? I get the following error.

Mixed Content: The page at 'https://app.web.dev/people' was loaded over HTTPS, 
but requested an insecure script 'http://127.0.0.1:35729/livereload.js?ext=Chrome&extver=2.1.0'. 
This request has been blocked; the content must be served over HTTPS.
@manatax
Copy link

manatax commented Nov 4, 2015

I need this too

@e2
Copy link
Contributor

e2 commented Nov 4, 2015

It would probably require creating and installing local SSL certificates.

@globalxolutions
Copy link

Will be a nice to have feature...

If you guys did not resolved yet, you might want to allow the browser to load the file.

In Chrome is as simple as clicking on the Shield Icon on the address bar and allowing it to run.

Hope it helps!

@richardonrails
Copy link

Developing a Rails app locally with HTTPS work together easily thanks to https://github.com/puma/puma-dev, so it would be nice to have a way for livereload to work on https pages too.

@rupurt rupurt closed this as completed Feb 7, 2019
@AlexWayfer
Copy link

@rupurt closed this 4 hours ago

What's the reason? Is this issue resolved?

@rupurt
Copy link
Author

rupurt commented Feb 7, 2019

@AlexWayfer I was closing out my unresolved issues. I can reopen if you still need it.

@rupurt rupurt reopened this Feb 7, 2019
@AlexWayfer
Copy link

@AlexWayfer I was closing out my unresolved issues.

Does it interfere somehow?

I can reopen if you still need it.

There are 7 participants. My opinion is not decisive.

@cmer
Copy link

cmer commented Oct 29, 2021

Is there a workaround for this?

@rhwinter
Copy link

rhwinter commented Dec 8, 2022

@cmer this seems to work (I'm on guard-livereload version 2.5.2 and also using rack-livereload version 0.4.2):

Make sure you add the correct options when loading guard-livereload in your Guardfile, like so:

guard 'livereload', secure: true, tls_options: {
  :private_key_file => key,
  :cert_chain_file => cert
} do
  watch(...

where key and cert are the location of your SSL certificates -key.pem and .pem files (the same ones you probably used when running puma, for example with ssl_bind '0.0.0.0', '9393', { key: key , cert: cert }.

Also, when loading rack-livereload (make sure you have version 0.4.2, see my comment further below about that), you have to add the SSL options (https and wss), something like (as per the readme):

use Rack::LiveReload, live_reload_scheme: 'wss', protocol: 'https'

For some reason, bundle wouldn't install version 0.4.2 of rack-livereload (it was stuck on 0.3.17, which is what rubygems report as being the latest). Anyways, because of that I also had to add 0.4.2 directly from GitHub to my Gemfile, like so:

gem 'rack-livereload', git: 'https://github.com/jaredmdobson/rack-livereload'

Hope this helps someone out there, it took me a while to get this going.

@richardonrails

This comment was marked as outdated.

@Kulgar
Copy link

Kulgar commented Apr 12, 2023

@rhwinter : thanks for sharing that solution! That really helped me! 🙇

@richardonrails
Copy link

richardonrails commented Sep 5, 2023

The issue with rack-livereload version has been fixed. So now with this Gemfile:

group :development do
  gem 'guard'
  gem 'guard-livereload', require: false
  gem 'rack-livereload'
end

I get latest versions of guard-livereload version of 2.5.2 and rack-livereload of 0.5.1.

However it's still unclear how to get HTTPS working when using puma-dev for https, since I don't have existing paths to private key/certs.

There hasn't been any movement on puma/puma-dev#326.

My development.rb config has: config.middleware.insert_after ActionDispatch::Static, Rack::LiveReload, no_swf: true, live_reload_scheme: 'wss', protocol: 'https'

My Guardfile currently has guard 'livereload', secure: true do

In my browser console I see errors like:
livereload.js?host=myapp.test:191 WebSocket connection to 'wss://myapp.test:35729/livereload' failed:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants