File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments