Not able to change the host #75

Open
opened 2017-09-18 16:13:59 +00:00 by mbajur · 3 comments
mbajur commented 2017-09-18 16:13:59 +00:00 (Migrated from github.com)

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$}  ]
  )
# ...
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$} ] ) # ... ```
pnghai commented 2018-07-13 08:12:43 +00:00 (Migrated from github.com)

You can try to use foreman in the mean time.

The line below have not been ready for your host config

c0c47cc83b/lib/rack/livereload/body_processor.rb (L17)

You can try to use foreman in the mean time. The line below have not been ready for your host config https://github.com/johnbintz/rack-livereload/blob/c0c47cc83b9e227ff3125fc4386311712f254f2e/lib/rack/livereload/body_processor.rb#L17
johnbintz commented 2018-07-13 12:29:20 +00:00 (Migrated from github.com)

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!

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!
AlexWayfer commented 2018-07-13 12:36:27 +00:00 (Migrated from github.com)

You should open a new issue/PR over there.

Issues disabled…

> You should open a new issue/PR over there. Issues disabled…
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: github-migration/rack-livereload#75
No description provided.