post https://apis.elai.io/api/v1/streams/candidate/
After exchanging SDP, it's essential to exchange network information to establish a connection fully. Within the peerConnection.onicecandidate() callback function, obtain the network information and submit it to the server.
Here's how you can do it:
peerConnection.onicecandidate = async (event) => {
if (!event.candidate) {
return
}
await fetch(`https://apis.elai.io/api/v1/stream/candidate/${streamId}`, {
method: "POST",
body: JSON.stringify({ candidate: event.candidate })
})
}