Describe the bug
When using cargo-leptos and the watch command, the <AutoReload> component injects some JS, and creates a WebSocket to ws://localhost:3001/live_reload. Unfortunately for me, I am running the server within a DevContainer, and accessing the site on the Host machine. I have forwarded the necessary ports in the Dockefile so that I can access the website (bound to 0.0.0.0:8000 in this case), but because the hot-reload script uses let host = window.location.hostname; to determine the root URL, when accessing the website from the Host web browser, the Console will repeatedly report:
(index):481 WebSocket connection to 'ws://localhost:3001/live_reload' failed: Connection closed before receiving a handshake response
(index):506 Live-reload disconnected. Reconnecting...
Ideally, the URL for hot-reloading should be the same as defined by leptos_options.site_addr.
Leptos Dependencies
leptos = { version = "0.8", default-features = false }
leptos_meta = "0.8"
leptos_router = "0.8"
Next Steps
Additional context
None
Describe the bug
When using
cargo-leptosand thewatchcommand, the<AutoReload>component injects some JS, and creates a WebSocket tows://localhost:3001/live_reload. Unfortunately for me, I am running the server within a DevContainer, and accessing the site on the Host machine. I have forwarded the necessary ports in the Dockefile so that I can access the website (bound to0.0.0.0:8000in this case), but because the hot-reload script useslet host = window.location.hostname;to determine the root URL, when accessing the website from the Host web browser, the Console will repeatedly report:Ideally, the URL for hot-reloading should be the same as defined by
leptos_options.site_addr.Leptos Dependencies
Next Steps
Additional context
None