johnbintz/rack-livereload

Not able to change the host

Opened this issue · 3 comments

Hello!

I'm trying to change the default host from localhost to livereload but it seems that rack-livereload is not seeing my changes. However! I'm totally able to modify the livereload port, just the host modification is broken.

Puma caught this error: Failed to open TCP connection to localhost:1234 (Cannot assign requested address - connect(2) for "localhost" port 1234) (Errno::EADDRNOTAVAIL)
/usr/local/lib/ruby/2.4.0/net/http.rb:906:in `rescue in block in connect'
/usr/local/lib/ruby/2.4.0/net/http.rb:903:in `block in connect'
/usr/local/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'
/usr/local/lib/ruby/2.4.0/timeout.rb:103:in `timeout'
/usr/local/lib/ruby/2.4.0/net/http.rb:902:in `connect'
/usr/local/lib/ruby/2.4.0/net/http.rb:887:in `do_start'
/usr/local/lib/ruby/2.4.0/net/http.rb:876:in `start'
/usr/local/lib/ruby/2.4.0/net/http.rb:1407:in `request'
/box/gems/rack-mini-profiler-0.10.5/lib/patches/net_patches.rb:7:in `block in request_with_mini_profiler'
/box/gems/rack-mini-profiler-0.10.5/lib/mini_profiler/profiling_methods.rb:31:in `step'
/box/gems/rack-mini-profiler-0.10.5/lib/patches/net_patches.rb:6:in `request_with_mini_profiler'
/usr/local/lib/ruby/2.4.0/net/http.rb:1387:in `send_request'
/box/gems/rack-livereload-0.3.16/lib/rack/livereload/body_processor.rb:50:in `use_vendored?'
/box/gems/rack-livereload-0.3.16/lib/rack/livereload/body_processor.rb:101:in `livereload_source'
(erb):14:in `block (2 levels) in process!'
/usr/local/lib/ruby/2.4.0/erb.rb:896:in `eval'
/usr/local/lib/ruby/2.4.0/erb.rb:896:in `result'
/box/gems/rack-livereload-0.3.16/lib/rack/livereload/body_processor.rb:78:in `block (2 levels) in process!'
/box/gems/activesupport-5.0.5/lib/active_support/core_ext/string/output_safety.rb:237:in `gsub!'
/box/gems/activesupport-5.0.5/lib/active_support/core_ext/string/output_safety.rb:237:in `gsub!'
/box/gems/rack-livereload-0.3.16/lib/rack/livereload/body_processor.rb:78:in `block in process!'
/box/gems/rack-livereload-0.3.16/lib/rack/livereload/body_processor.rb:76:in `each'
/box/gems/rack-livereload-0.3.16/lib/rack/livereload/body_processor.rb:76:in `process!'
/box/gems/rack-livereload-0.3.16/lib/rack/livereload.rb:28:in `_call'
/box/gems/rack-livereload-0.3.16/lib/rack/livereload.rb:14:in `call'
/box/gems/actionpack-5.0.5/lib/action_dispatch/middleware/static.rb:136:in `call'
/box/gems/rack-2.0.3/lib/rack/sendfile.rb:111:in `call'
/box/gems/rack-mini-profiler-0.10.5/lib/mini_profiler/profiler.rb:282:in `call'
/box/gems/railties-5.0.5/lib/rails/engine.rb:522:in `call'
/box/gems/puma-3.9.1/lib/puma/configuration.rb:224:in `call'
/box/gems/puma-3.9.1/lib/puma/server.rb:602:in `handle_request'
/box/gems/puma-3.9.1/lib/puma/server.rb:435:in `process_client'
/box/gems/puma-3.9.1/lib/puma/server.rb:299:in `block in run'
/box/gems/puma-3.9.1/lib/puma/thread_pool.rb:120:in `block in spawn_thread'

And my config:

# ...
  config.middleware.insert_after ActionDispatch::Static, Rack::LiveReload
  config.middleware.use(Rack::LiveReload,
    :min_delay        => 500,    # default 1000
    :max_delay        => 10_000, # default 60_000
    :live_reload_port => 1234,  # default 35729
    :host             => 'livereload',
    :ignore           => [ %r{dont/modify\.html$}  ]
  )
# ...

You can try to use foreman in the mean time.

The line below have not been ready for your host config

"#{protocol}://localhost:#{@options[:live_reload_port]}/livereload.js"

Hey, all. This project's been taken over by someone else and now lives at https://github.com/onesupercoder/rack-livereload. You should open a new issue/PR over there. Thanks!

You should open a new issue/PR over there.

Issues disabled…