Skip to content

Commit d62db42

Browse files
pmusarajCvX
andauthored
DEV: Fix livereload locally on https (#31776)
Previously, I was getting this error in the JS console: ``` livereload.js:2232 Mixed Content: The page at 'https://DOMAIN/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://DOMAIN:443/_lr/livereload'. This request has been blocked; this endpoint must be available over WSS. ```` Adding a `https: true` option seems to fix the problem when running the local server over an https proxy. (It'll be marked as `false` when the protocol isn't https.) This isn't just a warning, opening `/tests` is delayed about 10-20 seconds. --------- Co-authored-by: Jarek Radosz <jradosz@gmail.com>
1 parent e8f4433 commit d62db42

File tree

1 file changed

+1
-1
lines changed
  • app/assets/javascripts/custom-proxy

1 file changed

+1
-1
lines changed

app/assets/javascripts/custom-proxy/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function updateScriptReferences({
9898
// ember-cli-live-reload doesn't select ports correctly, so we use _lr/livereload directly
9999
// (important for cloud development environments like GitHub CodeSpaces)
100100
newElements.unshift(
101-
`<script nonce="${nonce}">window.LiveReloadOptions = { "path": "_lr/livereload", "host": location.hostname, "port": location.port || (location.protocol === "https:" ? 443 : 80) }</script>`,
101+
`<script nonce="${nonce}">window.LiveReloadOptions = { "path": "_lr/livereload", "host": location.hostname, "port": location.port || (location.protocol === "https:" ? 443 : 80), "https": location.protocol === "https:" }</script>`,
102102
`<script async src="/_lr/livereload.js" nonce="${nonce}"></script>`
103103
);
104104
}

0 commit comments

Comments
 (0)