From 1b78912759ea8417daa230e81ac9c7515c0b66fa Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sat, 20 Feb 2021 08:11:58 -0600 Subject: [PATCH] dynamic ws/wss selection --- web/src/api/mqtt.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/api/mqtt.jsx b/web/src/api/mqtt.jsx index 2d45593c78..6268b3d629 100644 --- a/web/src/api/mqtt.jsx +++ b/web/src/api/mqtt.jsx @@ -34,7 +34,7 @@ export function MqttProvider({ config, children, createWebsocket = defaultCreateWebsocket, - mqttUrl = `${baseUrl.replace(/^https?:/, 'ws:')}/ws`, + mqttUrl = `${baseUrl.replace(/^http/, 'ws')}/ws`, }) { const [state, dispatch] = useReducer(reducer, initialState); const wsRef = useRef();