Skip to content

Commit 486d74f

Browse files
committed
wip
1 parent 1fcd761 commit 486d74f

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎packages/remix-react/components.tsx‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,16 +1798,18 @@ export const LiveReload =
17981798
dangerouslySetInnerHTML={{
17991799
__html: js`
18001800
function remixLiveReloadConnect(config) {
1801-
let protocol = location.protocol === "https:" ? "wss:" : "ws:";
1801+
let REMIX_DEV_ORIGIN = ${JSON.stringify(
1802+
process.env.REMIX_DEV_ORIGIN
1803+
)};
1804+
let protocol =
1805+
REMIX_DEV_ORIGIN ? new URL(REMIX_DEV_ORIGIN).protocol.replace(/^http/, "ws") :
1806+
location.protocol === "https:" ? "wss:" : "ws:"; // remove in v2?
18021807
let hostname = location.hostname;
18031808
let url = new URL(protocol + "//" + hostname + "/socket");
18041809
1805-
let devOrigin = ${JSON.stringify(
1806-
process.env.REMIX_DEV_ORIGIN
1807-
)};
18081810
url.port =
18091811
${port} ||
1810-
(devOrigin && new URL(devOrigin).port) ||
1812+
REMIX_DEV_ORIGIN ? new URL(REMIX_DEV_ORIGIN).port :
18111813
Number(${
18121814
// TODO: remove in v2
18131815
process.env.REMIX_DEV_SERVER_WS_PORT

0 commit comments

Comments
 (0)