files/en-us/web/api/rtcpeerconnectioniceevent/index.md
{{APIRef("WebRTC")}}
The RTCPeerConnectionIceEvent interface represents events that occur in relation to {{Glossary("ICE")}} candidates with the target, usually an {{domxref("RTCPeerConnection")}}.
Only one event is of this type: {{domxref("RTCPeerConnection.icecandidate_event", "icecandidate")}}.
{{InheritanceDiagram}}
A RTCPeerConnectionIceEvent being an {{domxref("Event")}}, this event also implements these properties.
null if this event indicates that there are no further candidates to come.null if the candidate was not gathered from a server.RTCPeerConnectionIceEvent. It takes two parameters, the first being a string representing the type of the event; the second a dictionary containing the {{domxref("RTCIceCandidate")}} it refers to.A RTCPeerConnectionIceEvent being an {{domxref("Event")}}, this event also implements these properties. There is no specific {{domxref("RTCDataChannelEvent")}} method.
pc.onicecandidate = (ev) => {
console.log(
`The ICE candidate ('${ev.candidate.candidate}') added to connection.`,
);
};
{{Specifications}}
{{Compat}}