Skip to content

Commit 0abb4a9

Browse files
authored
Merge pull request YJU-OKURA#161 from yuminn-k/feat/add-turn-server
TURNサーバー設定の追加によるWebRTC接続性の向上
2 parents 3774d09 + 35c12e8 commit 0abb4a9

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/app/classes/[cId]/[mId]/components/manageSubComponents/LiveClass.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ const LiveClass: React.FC<LiveClassProps> = ({classId, userId}) => {
340340

341341
const startWebSocket = () => {
342342
const ws = new WebSocket(
343-
`ws://localhost:8080/?classId=${classId}&userId=${userId}`
344-
// `ws://43.203.217.108:8080/?classId=${classId}&userId=${userId}`
343+
// `ws://localhost:8080/?classId=${classId}&userId=${userId}`
344+
`ws://43.203.217.108:8080/?classId=${classId}&userId=${userId}`
345345
);
346346
wsRef.current = ws;
347347

@@ -418,6 +418,11 @@ const LiveClass: React.FC<LiveClassProps> = ({classId, userId}) => {
418418
'stun:stun4.l.google.com:19302',
419419
],
420420
},
421+
{
422+
urls: 'turn:60.70.80.91:3478',
423+
username: 'minori',
424+
credential: 'minoriwebrtc',
425+
},
421426
],
422427
});
423428
pcRef.current = pc;

src/app/classes/[cId]/[mId]/components/subComponents/LiveClassViewer.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ const LiveClassViewer: React.FC<LiveClassViewerProps> = ({classId, userId}) => {
248248

249249
const startWebSocket = () => {
250250
const ws = new WebSocket(
251-
`ws://localhost:8080/?classId=${classId}&userId=${userId}`
252-
// `ws://43.203.217.108:8080/?classId=${classId}&userId=${userId}`
251+
// `ws://localhost:8080/?classId=${classId}&userId=${userId}`
252+
`ws://43.203.217.108:8080/?classId=${classId}&userId=${userId}`
253253
);
254254
wsRef.current = ws;
255255

@@ -329,6 +329,11 @@ const LiveClassViewer: React.FC<LiveClassViewerProps> = ({classId, userId}) => {
329329
'stun:stun4.l.google.com:19302',
330330
],
331331
},
332+
{
333+
urls: 'turn:60.70.80.91:3478',
334+
username: 'minori',
335+
credential: 'minoriwebrtc',
336+
},
332337
],
333338
});
334339
pcRef.current = pc;

0 commit comments

Comments
 (0)