Skip to content

Commit 608cc84

Browse files
committed
feat: make websocket url configureable
1 parent 62b6756 commit 608cc84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/web_dev_utils/components.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule WebDevUtils.Components do
55
require EEx
66

77
@doc """
8-
A component for triggering live reloading.
8+
A component for triggering live reloading via a websocket
99
"""
1010
EEx.function_from_string(
1111
:def,
@@ -19,7 +19,7 @@ defmodule WebDevUtils.Components do
1919
}
2020
function connect() {
2121
try {
22-
window.socket = new WebSocket('wss://' + location.host + '/ws');
22+
window.socket = new WebSocket(<%= Application.get_env(:web_dev_utils, :reload_url, "'ws://' + location.host + '/ws'") %>);
2323
2424
window.socket.onmessage = function(e) {
2525
if (e.data === "reload") {

0 commit comments

Comments
 (0)