From 27063b7d20348e751a41ae620d43b4b2d8620d8d Mon Sep 17 00:00:00 2001 From: samcon Date: Fri, 21 Mar 2014 01:26:44 +0200 Subject: [PATCH] Set the protocol of the livereload source This will allow a user to serve livereload from HTTPS (Also requires using the :source => :livereload option) --- lib/rack/livereload/body_processor.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/rack/livereload/body_processor.rb b/lib/rack/livereload/body_processor.rb index 5f47c05..a07ca9c 100644 --- a/lib/rack/livereload/body_processor.rb +++ b/lib/rack/livereload/body_processor.rb @@ -9,8 +9,12 @@ module Rack attr_reader :content_length, :new_body, :livereload_added + def protocol + @options[:protocol] || "http" + end + def livereload_local_uri - "http://localhost:#{@options[:live_reload_port]}/livereload.js" + "#{protocol}://localhost:#{@options[:live_reload_port]}/livereload.js" end def initialize(body, options) -- 2.40.1