Explorar el Código

dynamic ws/wss selection

Blake Blackshear hace 4 años
padre
commit
31d408a746
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      web/src/api/mqtt.jsx

+ 1 - 1
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();