Skip to content

Commit

Permalink
fix stun servers
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Ribeiro committed Mar 26, 2022
1 parent 670cdb2 commit 1ed2732
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion web/src/components/Back/index.js
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import './styles.css'

const Back = ({ history }) => (
<div class="back-arrow" onClick={() => history.goBack()}>
<div className="back-arrow" onClick={() => history.goBack()}>
<svg
stroke="white"
fill="white"
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/Loader/index.js
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import './styles.css'

const Loader = () => (
<div class="lds-ripple">
<div className="lds-ripple">
<div></div>
<div></div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion web/src/screens/room/index.js
Expand Up @@ -129,10 +129,11 @@ export default function Room() {
})
}

useEffect(() => () => cleanUp)

useEffect(() => {
if (!user.profile || !user.profile.nickname) history.goBack()
else init()
return cleanUp
}, [user])

useEffect(() => {
Expand Down
12 changes: 2 additions & 10 deletions web/src/webrtc/peer.js
Expand Up @@ -3,14 +3,6 @@ import Peer from 'simple-peer'
const STUN_SERVERS = [
{ url: 'stun:stun.l.google.com:19302' },
{ url: 'stun:global.stun.twilio.com:3478?transport=udp' },
{ url: 'stun:stun1.l.google.com:19302' },
{ url: 'stun:stun2.l.google.com:19302' },
{ url: 'stun:stun3.l.google.com:19302' },
{ url: 'stun:stun4.l.google.com:19302' },
{ url: 'stun:stun.services.mozilla.com' },
{ url: 'stun:stun.anyfirewall.com' },
{ url: 'stun:stun.sipgate.net' },
{ url: 'stun:stun.sipgate.net:10000' },
]

function createNewPeer({
Expand All @@ -25,9 +17,9 @@ function createNewPeer({
initiator: initiator,
trickle: false,
config: {
iceServers: STUN_SERVERS.map((f) => {
iceServers: STUN_SERVERS.map((f) => ({
urls: f.url
}),
})),
},
}
if (stream) options.stream = stream
Expand Down

0 comments on commit 1ed2732

Please sign in to comment.