fix: use openrelay as turn

This commit is contained in:
2025-11-01 01:16:57 +01:00
parent f8be3f48e7
commit e8c691729e
4 changed files with 33 additions and 7 deletions

View File

@@ -15,6 +15,7 @@ const viewerStore = useViewerStore()
<PinInput
id="pin-input"
@complete="(viewerStore.code = $event.join(''))"
type="number"
>
<PinInputGroup>
<PinInputSlot

View File

@@ -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 ''
}

View File

@@ -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',

View File

@@ -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
});