TURN 服务器

This commit is contained in:
2023-10-01 12:47:39 +08:00
parent 2ce424dc6b
commit 914ae000d5
3 changed files with 38 additions and 2 deletions

View File

@@ -16,7 +16,13 @@ export default class ClientList {
websocket.onmessage = async event => {
const data = JSON.parse(event.data)
const webrtc_init = () => {
const webrtc = new RTCPeerConnection()
const webrtc = new RTCPeerConnection({
iceServers: [{
urls: 'turn:satori.love:3478',
username: 'your-username',
credential: 'your-password'
}]
})
webrtc.onicecandidate = event => {
if (event.candidate) {
websocket.send(JSON.stringify({