The read-only RTCDataChannel property protocol returns a string containing the name of the subprotocol in use.
RTCDataChannel
protocol
MDN Reference