diff --git a/web/src/api/mqtt.jsx b/web/src/api/mqtt.jsx index 2d45593c7..6268b3d62 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();