Skip to content

Commit 3935ca7

Browse files
committed
Chore: websocket domain edit
1 parent 460206a commit 3935ca7

File tree

1 file changed

+35
-34
lines changed

1 file changed

+35
-34
lines changed

src/views/meeting/components/MindMapComponent.tsx

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import useRecordingTimer from "@/views/meeting/components/RecodingTimer";
2424

2525
// import
2626
import { useEffect, useState, useRef } from "react";
27-
// import { Client } from "@stomp/stompjs";
27+
import { Client } from "@stomp/stompjs";
2828
import html2canvas from "html2canvas";
2929

3030
// type
@@ -72,39 +72,39 @@ const MindMapComponent = ({
7272

7373
const mindMapRef = useRef<HTMLDivElement>(null);
7474

75-
// const meetingStart = () => {
76-
// const client = new Client({
77-
// brokerURL: "wss://www.moaba.site/ws", // 서버 WebSocket URL q
78-
// reconnectDelay: 5000,
79-
// debug: (str) => {
80-
// console.log(str);
81-
// },
82-
// onConnect: () => {
83-
// console.log("연결");
84-
// client.subscribe(
85-
// `/topic/conference/${conferenceData.projectId}/participants`,
86-
// (message: any) => {
87-
// const data: any = JSON.parse(message.body);
88-
// console.log(data.participants);
89-
// }
90-
// );
91-
// },
92-
// onWebSocketError: (event) => {
93-
// console.error("❌ WebSocket 연결 실패:", event);
94-
// },
95-
// onStompError: (frame) => {
96-
// console.error("❌ STOMP 에러:", frame);
97-
// },
98-
// onConnect: (conn: any) => {
99-
// console.log('[+] WebSocket 연결이 되었습니다.', conn);
100-
// // client.subscribe(SUB_ENDPOINT, (message: IMessage) => {
101-
// // const receiveData = JSON.parse(message.body);
102-
// // });
103-
// },
104-
// });
105-
// console.log(client);
106-
// client.activate();
107-
// };
75+
const meetingStart = () => {
76+
const client = new Client({
77+
brokerURL: "ws://3.39.11.168:8080/ws", // 서버 WebSocket URL q
78+
reconnectDelay: 5000,
79+
debug: (str) => {
80+
console.log(str);
81+
},
82+
onConnect: () => {
83+
console.log("연결");
84+
client.subscribe(
85+
`/topic/conference/${conferenceData.projectId}/participants`,
86+
(message: any) => {
87+
const data: any = JSON.parse(message.body);
88+
console.log(data.participants);
89+
}
90+
);
91+
},
92+
onWebSocketError: (event) => {
93+
console.error("❌ WebSocket 연결 실패:", event);
94+
},
95+
onStompError: (frame) => {
96+
console.error("❌ STOMP 에러:", frame);
97+
},
98+
// onConnect: (conn: any) => {
99+
// console.log('[+] WebSocket 연결이 되었습니다.', conn);
100+
// // client.subscribe(SUB_ENDPOINT, (message: IMessage) => {
101+
// // const receiveData = JSON.parse(message.body);
102+
// // });
103+
// },
104+
});
105+
console.log(client);
106+
client.activate();
107+
};
108108

109109
// const handleDownload = (title: string, ref: React.RefObject<HTMLDivElement>) => () => {
110110
// if (!ref.current) return;
@@ -294,6 +294,7 @@ const MindMapComponent = ({
294294
onClick={() => {
295295
toggleListening().then(() => {
296296
setMode("live");
297+
meetingStart();
297298
});
298299
}}
299300
>

0 commit comments

Comments
 (0)