ember-cli-inject-live-reload icon indicating copy to clipboard operation
ember-cli-inject-live-reload copied to clipboard

--live-reload-* command line options need documentation

Open Redsandro opened this issue 6 years ago • 2 comments

I am trying to change my live-reload-host to localhost because my http port is proxied to a development url. It's unclear to find out how to do this.

$ ./node_modules/.bin/ember help | grep reload
  --live-reload (Boolean) (Default: true)
  --live-reload-host (String) Defaults to host
  --live-reload-base-url (String) Defaults to baseURL
  --live-reload-port (Number) (Defaults to port number within [49152...65535])

Needs documentation.

  • --live-reload-host changes the websocket host
  • --live-reload-base-url changes the javascript location relative to baseURL
  • ~~--live-reload-port doesn't seem to work in my setup~~ overridden by .ember-cli

I can't seem to change the javascript location. It's always {{rootURL}}/{{baseUrl}}/livereload.js. But I need to change the rootURL for the livereload location only.


ember-cli: 3.3.0
http_parser: 2.8.0
node: 8.12.0
v8: 6.2.414.66
uv: 1.19.2
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 57
nghttp2: 1.32.0
napi: 3
openssl: 1.0.2p
icu: 60.1
unicode: 10.0
cldr: 32.0
tz: 2017c
os: linux x64
npm: 6.4.1

Redsandro avatar Sep 22 '18 19:09 Redsandro

I was specifying the options wrong. The documentation is not entirely clear. Now that I specified host, the host doesn't change. livereload.js is still requested from the same domain as the domain. What is this option for anyway?

Redsandro avatar Sep 23 '18 16:09 Redsandro

What is this option for anyway?

Ah, it seems to change the hostname for the connection to the websocket that is opened. And then livereload doesn't work anymore, because from a security context, the websocket needs to be on the same hostname. So both hostnames would have to change; the one where the livereload.js is loaded from, and the one where the websocket is connecting to.

Redsandro avatar Sep 23 '18 16:09 Redsandro