mirror of
https://github.com/SrIzan10/helium.git
synced 2026-06-06 00:56:58 +00:00
fix: use openrelay as turn
This commit is contained in:
@@ -15,6 +15,7 @@ const viewerStore = useViewerStore()
|
||||
<PinInput
|
||||
id="pin-input"
|
||||
@complete="(viewerStore.code = $event.join(''))"
|
||||
type="number"
|
||||
>
|
||||
<PinInputGroup>
|
||||
<PinInputSlot
|
||||
|
||||
@@ -4,12 +4,6 @@ export const useWebSocketUrl = () => {
|
||||
const host = window.location.host
|
||||
return `${protocol}//${host}/ws/signaling`
|
||||
}
|
||||
const config = useRuntimeConfig()
|
||||
const isDev = process.dev
|
||||
|
||||
if (isDev) {
|
||||
return 'ws://localhost:3000/ws/signaling'
|
||||
}
|
||||
|
||||
return 'wss://helium.srizan.dev/ws/signaling'
|
||||
return ''
|
||||
}
|
||||
|
||||
@@ -24,6 +24,21 @@ const { send } = useWebSocket(wsUrl, {
|
||||
iceServers: [
|
||||
{ urls: 'stun:stun.l.google.com:19302' },
|
||||
{ urls: 'stun:stun1.l.google.com:19302' },
|
||||
{
|
||||
urls: 'turn:openrelay.metered.ca:80',
|
||||
username: 'openrelayproject',
|
||||
credential: 'openrelayproject',
|
||||
},
|
||||
{
|
||||
urls: 'turn:openrelay.metered.ca:443',
|
||||
username: 'openrelayproject',
|
||||
credential: 'openrelayproject',
|
||||
},
|
||||
{
|
||||
urls: 'turn:openrelay.metered.ca:443?transport=tcp',
|
||||
username: 'openrelayproject',
|
||||
credential: 'openrelayproject',
|
||||
},
|
||||
],
|
||||
iceCandidatePoolSize: 10
|
||||
});
|
||||
@@ -36,6 +51,7 @@ const { send } = useWebSocket(wsUrl, {
|
||||
};
|
||||
|
||||
peerConnection.onicecandidate = (event) => {
|
||||
console.log('onicecandidate', event.candidate);
|
||||
if (event.candidate) {
|
||||
send(JSON.stringify({
|
||||
event: 'ice-candidate',
|
||||
|
||||
@@ -27,6 +27,21 @@ const { send } = useWebSocket(wsUrl, {
|
||||
iceServers: [
|
||||
{ urls: 'stun:stun.l.google.com:19302' },
|
||||
{ urls: 'stun:stun1.l.google.com:19302' },
|
||||
{
|
||||
urls: 'turn:openrelay.metered.ca:80',
|
||||
username: 'openrelayproject',
|
||||
credential: 'openrelayproject',
|
||||
},
|
||||
{
|
||||
urls: 'turn:openrelay.metered.ca:443',
|
||||
username: 'openrelayproject',
|
||||
credential: 'openrelayproject',
|
||||
},
|
||||
{
|
||||
urls: 'turn:openrelay.metered.ca:443?transport=tcp',
|
||||
username: 'openrelayproject',
|
||||
credential: 'openrelayproject',
|
||||
},
|
||||
],
|
||||
iceCandidatePoolSize: 10
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user