Skip to content

Commit

Permalink
✨ feat: Add TURN server configuration for improved WebRTC connectivity
Browse files Browse the repository at this point in the history
Added TURN server configuration to enhance WebRTC connectivity and ensure reliable connections across different network environments. This update includes specifying TURN server URLs, along with appropriate credentials, to support scenarios where direct peer-to-peer connections are not feasible due to NAT or firewall restrictions.
  • Loading branch information
yuminn-k committed Jun 18, 2024
1 parent 3774d09 commit 35c12e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ const LiveClass: React.FC<LiveClassProps> = ({classId, userId}) => {

const startWebSocket = () => {
const ws = new WebSocket(
`ws://localhost:8080/?classId=${classId}&userId=${userId}`
// `ws://43.203.217.108:8080/?classId=${classId}&userId=${userId}`
// `ws://localhost:8080/?classId=${classId}&userId=${userId}`
`ws://43.203.217.108:8080/?classId=${classId}&userId=${userId}`
);
wsRef.current = ws;

Expand Down Expand Up @@ -418,6 +418,11 @@ const LiveClass: React.FC<LiveClassProps> = ({classId, userId}) => {
'stun:stun4.l.google.com:19302',
],
},
{
urls: 'turn:60.70.80.91:3478',
username: 'minori',
credential: 'minoriwebrtc',
},
],
});
pcRef.current = pc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ const LiveClassViewer: React.FC<LiveClassViewerProps> = ({classId, userId}) => {

const startWebSocket = () => {
const ws = new WebSocket(
`ws://localhost:8080/?classId=${classId}&userId=${userId}`
// `ws://43.203.217.108:8080/?classId=${classId}&userId=${userId}`
// `ws://localhost:8080/?classId=${classId}&userId=${userId}`
`ws://43.203.217.108:8080/?classId=${classId}&userId=${userId}`
);
wsRef.current = ws;

Expand Down Expand Up @@ -329,6 +329,11 @@ const LiveClassViewer: React.FC<LiveClassViewerProps> = ({classId, userId}) => {
'stun:stun4.l.google.com:19302',
],
},
{
urls: 'turn:60.70.80.91:3478',
username: 'minori',
credential: 'minoriwebrtc',
},
],
});
pcRef.current = pc;
Expand Down

0 comments on commit 35c12e8

Please sign in to comment.