Skip to content

DEV: Fix livereload locally on https #31776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 13, 2025
Merged

DEV: Fix livereload locally on https #31776

merged 2 commits into from
Mar 13, 2025

Conversation

pmusaraj
Copy link
Contributor

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.

Previously, I was getting this error in the 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.

This isn't just a warning, running /tests is delayed about 10-20 seconds.
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
@pmusaraj pmusaraj merged commit d62db42 into main Mar 13, 2025
17 checks passed
@pmusaraj pmusaraj deleted the fix-proxy-dev-livereload branch March 13, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants