Skip to content

Commit

Permalink
fix: add iceServers(#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
loopy-lim authored Nov 10, 2024
2 parents de2e08f + 7e4f11c commit 58e1001
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/fe-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
echo VITE_WS_URL=${{ secrets.VITE_WS_URL }} >> .env
echo VITE_PR_URL=${{ secrets.VITE_PR_URL }} >> .env
echo VITE_YJS_URL=${{ secrets.VITE_YJS_URL }} >> .env
echo VITE_RTC_ICE=${{ secrets.VITE_RTC_ICE }} >> .env
echo VITE_ICE_USER=${{ secrets.VITE_ICE_USER }} >> .env
echo VITE_ICE_PASS=${{ secrets.VITE_ICE_PASS }} >> .env
cat .env
- name: run deploy
Expand Down
10 changes: 9 additions & 1 deletion src/lib/peer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ export interface PeerConnection {

export const initializePeerConnection = async () => {
return new Promise<PeerConnection>((resolve) => {
const peer = new Peer();
const peer = new Peer({
config: {
'iceServers': [
{ url: import.meta.env.VITE_RTC_ICE, username: import.meta.env.VITE_ICE_USER, credential: import.meta.env.VITE_ICE_PASS },
{ url: 'stun:stun.l.google.com:19302' },
{ url: 'stun:stun1.l.google.com:19302' },
],
}
});
peer.once("open", (id) => {
resolve({ peer, id, peers: {} });
});
Expand Down

0 comments on commit 58e1001

Please sign in to comment.