소스 검색

dynamic ws/wss selection

Blake Blackshear 4 년 전
부모
커밋
31d408a746
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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();