Add stun/turn info after onIceCandidate
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
a4bc4b4d3b
commit
25e4b45198
@ -103,10 +103,21 @@ const MediaAgent = () => {
|
||||
if (!event.candidate) {
|
||||
return;
|
||||
}
|
||||
/* If a srflx candidate was found, notify that the STUN server works! */
|
||||
if (event.candidate.type === "srflx"){
|
||||
console.log("The STUN server is reachable!");
|
||||
console.log(` Your Public IP Address is: ${event.candidate.address}`);
|
||||
}
|
||||
|
||||
/* If a relay candidate was found, notify that the TURN server works! */
|
||||
if (event.candidate.type === "relay"){
|
||||
console.log("The TURN server is reachable !");
|
||||
}
|
||||
|
||||
sendMessage({
|
||||
type: 'relayICECandidate',
|
||||
type: 'relayICECandidate',
|
||||
config: {
|
||||
peer_id: peer_id,
|
||||
peer_id: peer_id,
|
||||
ice_candidate: {
|
||||
sdpMLineIndex: event.candidate.sdpMLineIndex,
|
||||
candidate: event.candidate.candidate
|
||||
@ -114,9 +125,9 @@ const MediaAgent = () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
connection.ontrack = e => refOnTrack.current(e);;
|
||||
|
||||
|
||||
/* Add our local stream */
|
||||
connection.addStream(stream);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user