Doesn't seem to work with non-standard port
Closed this issue · 2 comments
I'm kind of new to the whole ruby ecosystem and hope my question isn't too far-fetched.
What i'm currently trying to do is to build a basic dev setup for new projects starting thin webserver and guard via foreman.
Once i specify a non-standard port instead of 9292 in the first line of my config.ru to get my pages served from http://localhost:1337/ or others, livereload stops working because browsers are not able to connect via websocket to ws://localhost:35729/livereload (readyState 3).
config.ru
#\ -p 1337
require "rack-server-pages"
require "rack-livereload"
use Rack::LiveReload
run Rack::ServerPages
Procfile
guard: bundle exec guard
web: bundle exec rackup
Guardfile
guard 'sass', :input => 'sass', :output => 'public/css'
guard 'coffeescript', :input => 'coffee', :output => 'public/js'
guard 'livereload' do
watch(%r{public/.+\.(css|js|html)})
end
Could this be a bug?
It seems to be working for me, though I also have a Gemfile
and run Foreman using Bundler, so I don't have bundle exec
in the Procfile
, but that shouldn't make a real difference in this case. Try removing the other two guards from the Guardfile (sass and coffeescript) and see if that makes a difference, or put guard-livereload
at the top. Also, I find that turning off Guard interactions (guard -i
) with LiveReload offers a better experience.
I decided to ignore the problem and work on the default port 9292.
Several changes later, i can't reproduce the problem and everything runs fine on 1337 including rack-livereload.
Wont fix, can't reproduce.
Thanks for the help anway, very appreciated!