files/en-us/web/api/rtcpeerconnection/index.md
{{APIRef("WebRTC")}}
The RTCPeerConnection interface represents a WebRTC connection between the local computer and a remote peer.
It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed.
{{InheritanceDiagram}}
RTCPeerConnection, representing a connection between the local device and a remote peer.Also inherits properties from {{DOMxRef("EventTarget")}}.
new, connecting, connected, disconnected, failed, or closed.RTCPeerConnection finished negotiating and connecting to a remote peer.
Also included is a list of any ICE candidates that may already have been generated by the ICE agent since the offer or answer represented by the description was first instantiated.RTCPeerConnection finished negotiating and connecting to a remote peer.
Also included is a list of any ICE candidates that may already have been generated by the ICE agent since the offer or answer represented by the description was first instantiated.new, checking, connected, completed, failed, disconnected, or closed.new, gathering, or complete.null.null.null.stable, have-local-offer, have-remote-offer, have-local-pranswer, have-remote-pranswer, or closed.Also inherits methods from {{DOMxRef("EventTarget")}}.
RTCPeerConnection's remote description, which describes the state of the remote end of the connection.closed.Listen to these events using {{domxref("EventTarget.addEventListener", "addEventListener()")}} or by assigning an event listener to the oneventname property of this interface.
RTCPeerConnection changes.new), has begun gathering candidates (gathering), or has completed (complete).{{Specifications}}
{{Compat}}