@lakutata/webrtc 0.0.0-stage → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -0
- package/README.md +509 -2
- package/README.zh-CN.md +399 -0
- package/THIRD_PARTY_NOTICES.md +652 -0
- package/dist/cjs/client/SignalingConnection.d.ts +81 -0
- package/dist/cjs/client/SignalingConnection.js +67 -0
- package/dist/cjs/cluster/Cluster.d.ts +503 -0
- package/dist/cjs/cluster/Cluster.js +546 -0
- package/dist/cjs/cluster/ClusterFrames.d.ts +24 -0
- package/dist/cjs/cluster/ClusterFrames.js +90 -0
- package/dist/cjs/cluster/ClusterTURN.d.ts +63 -0
- package/dist/cjs/cluster/ClusterTURN.js +78 -0
- package/dist/cjs/cluster/Rendezvous.d.ts +8 -0
- package/dist/cjs/cluster/Rendezvous.js +23 -0
- package/dist/cjs/cluster/transports/ClusterTransport.d.ts +34 -0
- package/dist/cjs/cluster/transports/ClusterTransport.js +2 -0
- package/dist/cjs/cluster/transports/LoadClient.d.ts +6 -0
- package/dist/cjs/cluster/transports/LoadClient.js +80 -0
- package/dist/cjs/cluster/transports/MemoryClusterTransport.d.ts +13 -0
- package/dist/cjs/cluster/transports/MemoryClusterTransport.js +47 -0
- package/dist/cjs/cluster/transports/NATSClusterTransport.d.ts +23 -0
- package/dist/cjs/cluster/transports/NATSClusterTransport.js +70 -0
- package/dist/cjs/cluster/transports/RedisClusterTransport.d.ts +23 -0
- package/dist/cjs/cluster/transports/RedisClusterTransport.js +77 -0
- package/dist/cjs/exceptions/ClusterRequestException.d.ts +11 -0
- package/dist/cjs/exceptions/ClusterRequestException.js +18 -0
- package/dist/cjs/exceptions/ClusterTimeoutException.d.ts +10 -0
- package/dist/cjs/exceptions/ClusterTimeoutException.js +17 -0
- package/dist/cjs/exceptions/ClusterTransportNotFoundException.d.ts +11 -0
- package/dist/cjs/exceptions/ClusterTransportNotFoundException.js +18 -0
- package/dist/cjs/exceptions/SignalingClientRequiredException.d.ts +12 -0
- package/dist/cjs/exceptions/SignalingClientRequiredException.js +19 -0
- package/dist/cjs/exceptions/SignalingConnectionException.d.ts +12 -0
- package/dist/cjs/exceptions/SignalingConnectionException.js +19 -0
- package/dist/cjs/exceptions/SignalingDeniedException.d.ts +11 -0
- package/dist/cjs/exceptions/SignalingDeniedException.js +18 -0
- package/dist/cjs/exceptions/SignalingLimitException.d.ts +11 -0
- package/dist/cjs/exceptions/SignalingLimitException.js +18 -0
- package/dist/cjs/exceptions/SignalingNotAMemberException.d.ts +11 -0
- package/dist/cjs/exceptions/SignalingNotAMemberException.js +18 -0
- package/dist/cjs/exceptions/WHEPDeniedException.d.ts +15 -0
- package/dist/cjs/exceptions/WHEPDeniedException.js +22 -0
- package/dist/cjs/exceptions/WHEPLimitException.d.ts +15 -0
- package/dist/cjs/exceptions/WHEPLimitException.js +22 -0
- package/dist/cjs/exceptions/WHEPMediaTypeException.d.ts +15 -0
- package/dist/cjs/exceptions/WHEPMediaTypeException.js +22 -0
- package/dist/cjs/exceptions/WHEPOfferException.d.ts +16 -0
- package/dist/cjs/exceptions/WHEPOfferException.js +23 -0
- package/dist/cjs/exceptions/WHEPSessionNotFoundException.d.ts +15 -0
- package/dist/cjs/exceptions/WHEPSessionNotFoundException.js +22 -0
- package/dist/cjs/exceptions/WHIPDeniedException.d.ts +15 -0
- package/dist/cjs/exceptions/WHIPDeniedException.js +22 -0
- package/dist/cjs/exceptions/WHIPLimitException.d.ts +15 -0
- package/dist/cjs/exceptions/WHIPLimitException.js +22 -0
- package/dist/cjs/exceptions/WHIPMediaTypeException.d.ts +15 -0
- package/dist/cjs/exceptions/WHIPMediaTypeException.js +22 -0
- package/dist/cjs/exceptions/WHIPOfferException.d.ts +16 -0
- package/dist/cjs/exceptions/WHIPOfferException.js +23 -0
- package/dist/cjs/exceptions/WHIPSessionNotFoundException.d.ts +15 -0
- package/dist/cjs/exceptions/WHIPSessionNotFoundException.js +22 -0
- package/dist/cjs/exports/Client.d.ts +11 -0
- package/dist/cjs/exports/Client.js +29 -0
- package/dist/cjs/exports/WebRTC.d.ts +48 -0
- package/dist/cjs/exports/WebRTC.js +72 -0
- package/dist/cjs/lib/common/binary.d.ts +51 -0
- package/dist/cjs/lib/common/binary.js +264 -0
- package/dist/cjs/lib/common/binaryData.d.ts +116 -0
- package/dist/cjs/lib/common/binaryData.js +400 -0
- package/dist/cjs/lib/common/crc.d.ts +4 -0
- package/dist/cjs/lib/common/crc.js +122 -0
- package/dist/cjs/lib/common/deque.d.ts +36 -0
- package/dist/cjs/lib/common/deque.js +89 -0
- package/dist/cjs/lib/common/event.d.ts +48 -0
- package/dist/cjs/lib/common/event.js +207 -0
- package/dist/cjs/lib/common/index.d.ts +11 -0
- package/dist/cjs/lib/common/index.js +50 -0
- package/dist/cjs/lib/common/log.d.ts +47 -0
- package/dist/cjs/lib/common/log.js +62 -0
- package/dist/cjs/lib/common/network.d.ts +10 -0
- package/dist/cjs/lib/common/network.js +60 -0
- package/dist/cjs/lib/common/number.d.ts +13 -0
- package/dist/cjs/lib/common/number.js +43 -0
- package/dist/cjs/lib/common/promise.d.ts +21 -0
- package/dist/cjs/lib/common/promise.js +70 -0
- package/dist/cjs/lib/common/transport.d.ts +104 -0
- package/dist/cjs/lib/common/transport.js +441 -0
- package/dist/cjs/lib/common/type.d.ts +3 -0
- package/dist/cjs/lib/common/type.js +2 -0
- package/dist/cjs/lib/dtls/cipher/const.d.ts +42 -0
- package/dist/cjs/lib/dtls/cipher/const.js +33 -0
- package/dist/cjs/lib/dtls/cipher/create.d.ts +21 -0
- package/dist/cjs/lib/dtls/cipher/create.js +105 -0
- package/dist/cjs/lib/dtls/cipher/ec.d.ts +28 -0
- package/dist/cjs/lib/dtls/cipher/ec.js +44 -0
- package/dist/cjs/lib/dtls/cipher/key-exchange.d.ts +43 -0
- package/dist/cjs/lib/dtls/cipher/key-exchange.js +113 -0
- package/dist/cjs/lib/dtls/cipher/namedCurve.d.ts +7 -0
- package/dist/cjs/lib/dtls/cipher/namedCurve.js +27 -0
- package/dist/cjs/lib/dtls/cipher/prf.d.ts +17 -0
- package/dist/cjs/lib/dtls/cipher/prf.js +92 -0
- package/dist/cjs/lib/dtls/cipher/suites/abstract.d.ts +40 -0
- package/dist/cjs/lib/dtls/cipher/suites/abstract.js +41 -0
- package/dist/cjs/lib/dtls/cipher/suites/aead.d.ts +28 -0
- package/dist/cjs/lib/dtls/cipher/suites/aead.js +132 -0
- package/dist/cjs/lib/dtls/cipher/suites/null.d.ts +24 -0
- package/dist/cjs/lib/dtls/cipher/suites/null.js +41 -0
- package/dist/cjs/lib/dtls/cipher/utils.d.ts +18 -0
- package/dist/cjs/lib/dtls/cipher/utils.js +70 -0
- package/dist/cjs/lib/dtls/cipher/x509.d.ts +33 -0
- package/dist/cjs/lib/dtls/cipher/x509.js +100 -0
- package/dist/cjs/lib/dtls/client.d.ts +7 -0
- package/dist/cjs/lib/dtls/client.js +76 -0
- package/dist/cjs/lib/dtls/context/cipher.d.ts +42 -0
- package/dist/cjs/lib/dtls/context/cipher.js +87 -0
- package/dist/cjs/lib/dtls/context/dtls.d.ts +38 -0
- package/dist/cjs/lib/dtls/context/dtls.js +49 -0
- package/dist/cjs/lib/dtls/context/srtp.d.ts +5 -0
- package/dist/cjs/lib/dtls/context/srtp.js +12 -0
- package/dist/cjs/lib/dtls/context/transport.d.ts +8 -0
- package/dist/cjs/lib/dtls/context/transport.js +17 -0
- package/dist/cjs/lib/dtls/flight/client/flight1.d.ts +10 -0
- package/dist/cjs/lib/dtls/flight/client/flight1.js +26 -0
- package/dist/cjs/lib/dtls/flight/client/flight3.d.ts +8 -0
- package/dist/cjs/lib/dtls/flight/client/flight3.js +25 -0
- package/dist/cjs/lib/dtls/flight/client/flight5.d.ts +18 -0
- package/dist/cjs/lib/dtls/flight/client/flight5.js +206 -0
- package/dist/cjs/lib/dtls/flight/flight.d.ts +18 -0
- package/dist/cjs/lib/dtls/flight/flight.js +68 -0
- package/dist/cjs/lib/dtls/flight/server/flight2.d.ts +6 -0
- package/dist/cjs/lib/dtls/flight/server/flight2.js +126 -0
- package/dist/cjs/lib/dtls/flight/server/flight4.d.ts +17 -0
- package/dist/cjs/lib/dtls/flight/server/flight4.js +87 -0
- package/dist/cjs/lib/dtls/flight/server/flight6.d.ts +13 -0
- package/dist/cjs/lib/dtls/flight/server/flight6.js +111 -0
- package/dist/cjs/lib/dtls/handshake/binary.d.ts +16 -0
- package/dist/cjs/lib/dtls/handshake/binary.js +20 -0
- package/dist/cjs/lib/dtls/handshake/const.d.ts +13 -0
- package/dist/cjs/lib/dtls/handshake/const.js +17 -0
- package/dist/cjs/lib/dtls/handshake/extensions/ellipticCurves.d.ts +17 -0
- package/dist/cjs/lib/dtls/handshake/extensions/ellipticCurves.js +40 -0
- package/dist/cjs/lib/dtls/handshake/extensions/extendedMasterSecret.d.ts +3 -0
- package/dist/cjs/lib/dtls/handshake/extensions/extendedMasterSecret.js +7 -0
- package/dist/cjs/lib/dtls/handshake/extensions/renegotiationIndication.d.ts +18 -0
- package/dist/cjs/lib/dtls/handshake/extensions/renegotiationIndication.js +34 -0
- package/dist/cjs/lib/dtls/handshake/extensions/signature.d.ts +26 -0
- package/dist/cjs/lib/dtls/handshake/extensions/signature.js +39 -0
- package/dist/cjs/lib/dtls/handshake/extensions/useSrtp.d.ts +19 -0
- package/dist/cjs/lib/dtls/handshake/extensions/useSrtp.js +65 -0
- package/dist/cjs/lib/dtls/handshake/message/alert.d.ts +12 -0
- package/dist/cjs/lib/dtls/handshake/message/alert.js +24 -0
- package/dist/cjs/lib/dtls/handshake/message/certificate.d.ts +17 -0
- package/dist/cjs/lib/dtls/handshake/message/certificate.js +35 -0
- package/dist/cjs/lib/dtls/handshake/message/changeCipherSpec.d.ts +11 -0
- package/dist/cjs/lib/dtls/handshake/message/changeCipherSpec.js +24 -0
- package/dist/cjs/lib/dtls/handshake/message/client/certificateVerify.d.ts +20 -0
- package/dist/cjs/lib/dtls/handshake/message/client/certificateVerify.js +35 -0
- package/dist/cjs/lib/dtls/handshake/message/client/hello.d.ts +50 -0
- package/dist/cjs/lib/dtls/handshake/message/client/hello.js +48 -0
- package/dist/cjs/lib/dtls/handshake/message/client/keyExchange.d.ts +17 -0
- package/dist/cjs/lib/dtls/handshake/message/client/keyExchange.js +33 -0
- package/dist/cjs/lib/dtls/handshake/message/finished.d.ts +13 -0
- package/dist/cjs/lib/dtls/handshake/message/finished.js +26 -0
- package/dist/cjs/lib/dtls/handshake/message/server/certificateRequest.d.ts +31 -0
- package/dist/cjs/lib/dtls/handshake/message/server/certificateRequest.js +38 -0
- package/dist/cjs/lib/dtls/handshake/message/server/hello.d.ts +33 -0
- package/dist/cjs/lib/dtls/handshake/message/server/hello.js +57 -0
- package/dist/cjs/lib/dtls/handshake/message/server/helloDone.d.ts +12 -0
- package/dist/cjs/lib/dtls/handshake/message/server/helloDone.js +30 -0
- package/dist/cjs/lib/dtls/handshake/message/server/helloVerifyRequest.d.ts +32 -0
- package/dist/cjs/lib/dtls/handshake/message/server/helloVerifyRequest.js +42 -0
- package/dist/cjs/lib/dtls/handshake/message/server/keyExchange.d.ts +32 -0
- package/dist/cjs/lib/dtls/handshake/message/server/keyExchange.js +49 -0
- package/dist/cjs/lib/dtls/handshake/random.d.ts +13 -0
- package/dist/cjs/lib/dtls/handshake/random.js +29 -0
- package/dist/cjs/lib/dtls/helper.d.ts +4 -0
- package/dist/cjs/lib/dtls/helper.js +30 -0
- package/dist/cjs/lib/dtls/imports/common.d.ts +1 -0
- package/dist/cjs/lib/dtls/imports/common.js +17 -0
- package/dist/cjs/lib/dtls/imports/rtp.d.ts +1 -0
- package/dist/cjs/lib/dtls/imports/rtp.js +17 -0
- package/dist/cjs/lib/dtls/index.d.ts +7 -0
- package/dist/cjs/lib/dtls/index.js +117 -0
- package/dist/cjs/lib/dtls/record/antiReplayWindow.d.ts +27 -0
- package/dist/cjs/lib/dtls/record/antiReplayWindow.js +102 -0
- package/dist/cjs/lib/dtls/record/builder.d.ts +9 -0
- package/dist/cjs/lib/dtls/record/builder.js +27 -0
- package/dist/cjs/lib/dtls/record/const.d.ts +33 -0
- package/dist/cjs/lib/dtls/record/const.js +38 -0
- package/dist/cjs/lib/dtls/record/message/fragment.d.ts +26 -0
- package/dist/cjs/lib/dtls/record/message/fragment.js +96 -0
- package/dist/cjs/lib/dtls/record/message/header.d.ts +38 -0
- package/dist/cjs/lib/dtls/record/message/header.js +34 -0
- package/dist/cjs/lib/dtls/record/message/plaintext.d.ts +14 -0
- package/dist/cjs/lib/dtls/record/message/plaintext.js +63 -0
- package/dist/cjs/lib/dtls/record/receive.d.ts +9 -0
- package/dist/cjs/lib/dtls/record/receive.js +91 -0
- package/dist/cjs/lib/dtls/server.d.ts +6 -0
- package/dist/cjs/lib/dtls/server.js +78 -0
- package/dist/cjs/lib/dtls/socket.d.ts +52 -0
- package/dist/cjs/lib/dtls/socket.js +188 -0
- package/dist/cjs/lib/dtls/typings/domain.d.ts +20 -0
- package/dist/cjs/lib/dtls/typings/domain.js +2 -0
- package/dist/cjs/lib/dtls/util/binary.d.ts +2 -0
- package/dist/cjs/lib/dtls/util/binary.js +8 -0
- package/dist/cjs/lib/ice/candidate.d.ts +35 -0
- package/dist/cjs/lib/ice/candidate.js +198 -0
- package/dist/cjs/lib/ice/dns/lookup.d.ts +16 -0
- package/dist/cjs/lib/ice/dns/lookup.js +133 -0
- package/dist/cjs/lib/ice/dns/mdns.d.ts +38 -0
- package/dist/cjs/lib/ice/dns/mdns.js +145 -0
- package/dist/cjs/lib/ice/exceptions.d.ts +24 -0
- package/dist/cjs/lib/ice/exceptions.js +41 -0
- package/dist/cjs/lib/ice/helper.d.ts +17 -0
- package/dist/cjs/lib/ice/helper.js +74 -0
- package/dist/cjs/lib/ice/ice.d.ts +182 -0
- package/dist/cjs/lib/ice/ice.js +1584 -0
- package/dist/cjs/lib/ice/iceBase.d.ts +214 -0
- package/dist/cjs/lib/ice/iceBase.js +182 -0
- package/dist/cjs/lib/ice/imports/common.d.ts +1 -0
- package/dist/cjs/lib/ice/imports/common.js +17 -0
- package/dist/cjs/lib/ice/index.d.ts +12 -0
- package/dist/cjs/lib/ice/index.js +30 -0
- package/dist/cjs/lib/ice/internal/selectAddresses.d.ts +9 -0
- package/dist/cjs/lib/ice/internal/selectAddresses.js +39 -0
- package/dist/cjs/lib/ice/stun/attributes.d.ts +1 -0
- package/dist/cjs/lib/ice/stun/attributes.js +17 -0
- package/dist/cjs/lib/ice/stun/const.d.ts +8 -0
- package/dist/cjs/lib/ice/stun/const.js +25 -0
- package/dist/cjs/lib/ice/stun/message.d.ts +1 -0
- package/dist/cjs/lib/ice/stun/message.js +17 -0
- package/dist/cjs/lib/ice/stun/protocol.d.ts +30 -0
- package/dist/cjs/lib/ice/stun/protocol.js +125 -0
- package/dist/cjs/lib/ice/stun/tcpFrame.d.ts +5 -0
- package/dist/cjs/lib/ice/stun/tcpFrame.js +25 -0
- package/dist/cjs/lib/ice/stun/tcpProtocol.d.ts +57 -0
- package/dist/cjs/lib/ice/stun/tcpProtocol.js +323 -0
- package/dist/cjs/lib/ice/stun/transaction.d.ts +75 -0
- package/dist/cjs/lib/ice/stun/transaction.js +239 -0
- package/dist/cjs/lib/ice/turn/frame.d.ts +1 -0
- package/dist/cjs/lib/ice/turn/frame.js +17 -0
- package/dist/cjs/lib/ice/turn/protocol.d.ts +170 -0
- package/dist/cjs/lib/ice/turn/protocol.js +638 -0
- package/dist/cjs/lib/ice/types/model.d.ts +56 -0
- package/dist/cjs/lib/ice/types/model.js +2 -0
- package/dist/cjs/lib/ice/utils.d.ts +13 -0
- package/dist/cjs/lib/ice/utils.js +84 -0
- package/dist/cjs/lib/peer/const.d.ts +36 -0
- package/dist/cjs/lib/peer/const.js +53 -0
- package/dist/cjs/lib/peer/dataChannel.d.ts +69 -0
- package/dist/cjs/lib/peer/dataChannel.js +133 -0
- package/dist/cjs/lib/peer/errors.d.ts +11 -0
- package/dist/cjs/lib/peer/errors.js +23 -0
- package/dist/cjs/lib/peer/helper.d.ts +20 -0
- package/dist/cjs/lib/peer/helper.js +84 -0
- package/dist/cjs/lib/peer/imports/common.d.ts +1 -0
- package/dist/cjs/lib/peer/imports/common.js +17 -0
- package/dist/cjs/lib/peer/imports/dtls.d.ts +1 -0
- package/dist/cjs/lib/peer/imports/dtls.js +17 -0
- package/dist/cjs/lib/peer/imports/ice.d.ts +1 -0
- package/dist/cjs/lib/peer/imports/ice.js +17 -0
- package/dist/cjs/lib/peer/imports/rtp.d.ts +1 -0
- package/dist/cjs/lib/peer/imports/rtp.js +17 -0
- package/dist/cjs/lib/peer/index.d.ts +14 -0
- package/dist/cjs/lib/peer/index.js +30 -0
- package/dist/cjs/lib/peer/media/codec.d.ts +15 -0
- package/dist/cjs/lib/peer/media/codec.js +80 -0
- package/dist/cjs/lib/peer/media/codecCompatibility.d.ts +23 -0
- package/dist/cjs/lib/peer/media/codecCompatibility.js +137 -0
- package/dist/cjs/lib/peer/media/extension/rtcpFeedback.d.ts +6 -0
- package/dist/cjs/lib/peer/media/extension/rtcpFeedback.js +13 -0
- package/dist/cjs/lib/peer/media/extension/rtpExtension.d.ts +9 -0
- package/dist/cjs/lib/peer/media/extension/rtpExtension.js +52 -0
- package/dist/cjs/lib/peer/media/index.d.ts +12 -0
- package/dist/cjs/lib/peer/media/index.js +28 -0
- package/dist/cjs/lib/peer/media/parameters.d.ts +65 -0
- package/dist/cjs/lib/peer/media/parameters.js +60 -0
- package/dist/cjs/lib/peer/media/receiver/nack.d.ts +23 -0
- package/dist/cjs/lib/peer/media/receiver/nack.js +104 -0
- package/dist/cjs/lib/peer/media/receiver/receiverTwcc.d.ts +47 -0
- package/dist/cjs/lib/peer/media/receiver/receiverTwcc.js +179 -0
- package/dist/cjs/lib/peer/media/receiver/statistics.d.ts +22 -0
- package/dist/cjs/lib/peer/media/receiver/statistics.js +71 -0
- package/dist/cjs/lib/peer/media/router.d.ts +25 -0
- package/dist/cjs/lib/peer/media/router.js +166 -0
- package/dist/cjs/lib/peer/media/rtpReceiver.d.ts +90 -0
- package/dist/cjs/lib/peer/media/rtpReceiver.js +407 -0
- package/dist/cjs/lib/peer/media/rtpSender.d.ts +209 -0
- package/dist/cjs/lib/peer/media/rtpSender.js +826 -0
- package/dist/cjs/lib/peer/media/rtpTransceiver.d.ts +117 -0
- package/dist/cjs/lib/peer/media/rtpTransceiver.js +245 -0
- package/dist/cjs/lib/peer/media/sender/cumulativeResult.d.ts +19 -0
- package/dist/cjs/lib/peer/media/sender/cumulativeResult.js +61 -0
- package/dist/cjs/lib/peer/media/sender/senderBWE.d.ts +32 -0
- package/dist/cjs/lib/peer/media/sender/senderBWE.js +99 -0
- package/dist/cjs/lib/peer/media/stats.d.ts +293 -0
- package/dist/cjs/lib/peer/media/stats.js +90 -0
- package/dist/cjs/lib/peer/media/track.d.ts +67 -0
- package/dist/cjs/lib/peer/media/track.js +216 -0
- package/dist/cjs/lib/peer/peerConnection.d.ts +458 -0
- package/dist/cjs/lib/peer/peerConnection.js +1591 -0
- package/dist/cjs/lib/peer/sctpManager.d.ts +28 -0
- package/dist/cjs/lib/peer/sctpManager.js +138 -0
- package/dist/cjs/lib/peer/sdp.d.ts +97 -0
- package/dist/cjs/lib/peer/sdp.js +628 -0
- package/dist/cjs/lib/peer/sdpManager.d.ts +116 -0
- package/dist/cjs/lib/peer/sdpManager.js +573 -0
- package/dist/cjs/lib/peer/secureTransportManager.d.ts +96 -0
- package/dist/cjs/lib/peer/secureTransportManager.js +472 -0
- package/dist/cjs/lib/peer/transceiverManager.d.ts +151 -0
- package/dist/cjs/lib/peer/transceiverManager.js +767 -0
- package/dist/cjs/lib/peer/transport/dtls.d.ts +95 -0
- package/dist/cjs/lib/peer/transport/dtls.js +571 -0
- package/dist/cjs/lib/peer/transport/ice.d.ts +143 -0
- package/dist/cjs/lib/peer/transport/ice.js +436 -0
- package/dist/cjs/lib/peer/transport/sctp.d.ts +56 -0
- package/dist/cjs/lib/peer/transport/sctp.js +387 -0
- package/dist/cjs/lib/peer/types/domain.d.ts +5 -0
- package/dist/cjs/lib/peer/types/domain.js +19 -0
- package/dist/cjs/lib/peer/types/util.d.ts +2 -0
- package/dist/cjs/lib/peer/types/util.js +2 -0
- package/dist/cjs/lib/peer/utils.d.ts +73 -0
- package/dist/cjs/lib/peer/utils.js +306 -0
- package/dist/cjs/lib/rtp/codec/av1.d.ts +56 -0
- package/dist/cjs/lib/rtp/codec/av1.js +209 -0
- package/dist/cjs/lib/rtp/codec/base.d.ts +8 -0
- package/dist/cjs/lib/rtp/codec/base.js +15 -0
- package/dist/cjs/lib/rtp/codec/h264.d.ts +32 -0
- package/dist/cjs/lib/rtp/codec/h264.js +122 -0
- package/dist/cjs/lib/rtp/codec/index.d.ts +16 -0
- package/dist/cjs/lib/rtp/codec/index.js +84 -0
- package/dist/cjs/lib/rtp/codec/leb128.d.ts +5 -0
- package/dist/cjs/lib/rtp/codec/leb128.js +23 -0
- package/dist/cjs/lib/rtp/codec/opus.d.ts +9 -0
- package/dist/cjs/lib/rtp/codec/opus.js +25 -0
- package/dist/cjs/lib/rtp/codec/vp8.d.ts +27 -0
- package/dist/cjs/lib/rtp/codec/vp8.js +109 -0
- package/dist/cjs/lib/rtp/codec/vp9.d.ts +46 -0
- package/dist/cjs/lib/rtp/codec/vp9.js +161 -0
- package/dist/cjs/lib/rtp/const.d.ts +1 -0
- package/dist/cjs/lib/rtp/const.js +4 -0
- package/dist/cjs/lib/rtp/helper.d.ts +8 -0
- package/dist/cjs/lib/rtp/helper.js +36 -0
- package/dist/cjs/lib/rtp/imports/common.d.ts +1 -0
- package/dist/cjs/lib/rtp/imports/common.js +17 -0
- package/dist/cjs/lib/rtp/index.d.ts +25 -0
- package/dist/cjs/lib/rtp/index.js +41 -0
- package/dist/cjs/lib/rtp/rtcp/header.d.ts +13 -0
- package/dist/cjs/lib/rtp/rtcp/header.js +50 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/fullIntraRequest.d.ts +16 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/fullIntraRequest.js +34 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/index.d.ts +14 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/index.js +39 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/pictureLossIndication.d.ts +10 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/pictureLossIndication.js +20 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/remb.d.ts +16 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/remb.js +53 -0
- package/dist/cjs/lib/rtp/rtcp/rr.d.ts +32 -0
- package/dist/cjs/lib/rtp/rtcp/rr.js +73 -0
- package/dist/cjs/lib/rtp/rtcp/rtcp.d.ts +10 -0
- package/dist/cjs/lib/rtp/rtcp/rtcp.js +58 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/const.d.ts +1 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/const.js +4 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/index.d.ts +14 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/index.js +35 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/nack.d.ts +17 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/nack.js +77 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/twcc.d.ts +71 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/twcc.js +352 -0
- package/dist/cjs/lib/rtp/rtcp/sdes.d.ts +26 -0
- package/dist/cjs/lib/rtp/rtcp/sdes.js +97 -0
- package/dist/cjs/lib/rtp/rtcp/sr.d.ts +41 -0
- package/dist/cjs/lib/rtp/rtcp/sr.js +110 -0
- package/dist/cjs/lib/rtp/rtp/headerExtension.d.ts +72 -0
- package/dist/cjs/lib/rtp/rtp/headerExtension.js +117 -0
- package/dist/cjs/lib/rtp/rtp/red/encoder.d.ts +13 -0
- package/dist/cjs/lib/rtp/rtp/red/encoder.js +44 -0
- package/dist/cjs/lib/rtp/rtp/red/handler.d.ts +6 -0
- package/dist/cjs/lib/rtp/rtp/red/handler.js +59 -0
- package/dist/cjs/lib/rtp/rtp/red/packet.d.ts +26 -0
- package/dist/cjs/lib/rtp/rtp/red/packet.js +112 -0
- package/dist/cjs/lib/rtp/rtp/rtp.d.ts +44 -0
- package/dist/cjs/lib/rtp/rtp/rtp.js +271 -0
- package/dist/cjs/lib/rtp/rtp/rtx.d.ts +3 -0
- package/dist/cjs/lib/rtp/rtp/rtx.js +29 -0
- package/dist/cjs/lib/rtp/srtp/cipher/ctr.d.ts +16 -0
- package/dist/cjs/lib/rtp/srtp/cipher/ctr.js +107 -0
- package/dist/cjs/lib/rtp/srtp/cipher/gcm.d.ts +17 -0
- package/dist/cjs/lib/rtp/srtp/cipher/gcm.js +145 -0
- package/dist/cjs/lib/rtp/srtp/cipher/index.d.ts +13 -0
- package/dist/cjs/lib/rtp/srtp/cipher/index.js +24 -0
- package/dist/cjs/lib/rtp/srtp/const.d.ts +6 -0
- package/dist/cjs/lib/rtp/srtp/const.js +26 -0
- package/dist/cjs/lib/rtp/srtp/context/context.d.ts +45 -0
- package/dist/cjs/lib/rtp/srtp/context/context.js +180 -0
- package/dist/cjs/lib/rtp/srtp/context/srtcp.d.ts +8 -0
- package/dist/cjs/lib/rtp/srtp/context/srtcp.js +25 -0
- package/dist/cjs/lib/rtp/srtp/context/srtp.d.ts +9 -0
- package/dist/cjs/lib/rtp/srtp/context/srtp.js +41 -0
- package/dist/cjs/lib/rtp/srtp/error.d.ts +3 -0
- package/dist/cjs/lib/rtp/srtp/error.js +10 -0
- package/dist/cjs/lib/rtp/srtp/packet.d.ts +5 -0
- package/dist/cjs/lib/rtp/srtp/packet.js +47 -0
- package/dist/cjs/lib/rtp/srtp/session.d.ts +19 -0
- package/dist/cjs/lib/rtp/srtp/session.js +13 -0
- package/dist/cjs/lib/rtp/srtp/srtcp.d.ts +8 -0
- package/dist/cjs/lib/rtp/srtp/srtcp.js +21 -0
- package/dist/cjs/lib/rtp/srtp/srtp.d.ts +9 -0
- package/dist/cjs/lib/rtp/srtp/srtp.js +20 -0
- package/dist/cjs/lib/rtp/transport.d.ts +15 -0
- package/dist/cjs/lib/rtp/transport.js +23 -0
- package/dist/cjs/lib/rtp/util.d.ts +11 -0
- package/dist/cjs/lib/rtp/util.js +28 -0
- package/dist/cjs/lib/sctp/chunk.d.ts +164 -0
- package/dist/cjs/lib/sctp/chunk.js +542 -0
- package/dist/cjs/lib/sctp/const.d.ts +17 -0
- package/dist/cjs/lib/sctp/const.js +22 -0
- package/dist/cjs/lib/sctp/helper.d.ts +5 -0
- package/dist/cjs/lib/sctp/helper.js +14 -0
- package/dist/cjs/lib/sctp/imports/common.d.ts +1 -0
- package/dist/cjs/lib/sctp/imports/common.js +17 -0
- package/dist/cjs/lib/sctp/index.d.ts +6 -0
- package/dist/cjs/lib/sctp/index.js +20 -0
- package/dist/cjs/lib/sctp/param.d.ts +40 -0
- package/dist/cjs/lib/sctp/param.js +132 -0
- package/dist/cjs/lib/sctp/sctp.d.ts +210 -0
- package/dist/cjs/lib/sctp/sctp.js +1467 -0
- package/dist/cjs/lib/sctp/transport.d.ts +15 -0
- package/dist/cjs/lib/sctp/transport.js +28 -0
- package/dist/cjs/lib/turn/index.d.ts +9 -0
- package/dist/cjs/lib/turn/index.js +25 -0
- package/dist/cjs/lib/turn/node/server.d.ts +21 -0
- package/dist/cjs/lib/turn/node/server.js +94 -0
- package/dist/cjs/lib/turn/node/turnServer.d.ts +91 -0
- package/dist/cjs/lib/turn/node/turnServer.js +565 -0
- package/dist/cjs/lib/turn/protocol.d.ts +47 -0
- package/dist/cjs/lib/turn/protocol.js +116 -0
- package/dist/cjs/lib/turn/stun/attributes.d.ts +37 -0
- package/dist/cjs/lib/turn/stun/attributes.js +208 -0
- package/dist/cjs/lib/turn/stun/const.d.ts +28 -0
- package/dist/cjs/lib/turn/stun/const.js +87 -0
- package/dist/cjs/lib/turn/stun/ip.d.ts +12 -0
- package/dist/cjs/lib/turn/stun/ip.js +87 -0
- package/dist/cjs/lib/turn/stun/message.d.ts +37 -0
- package/dist/cjs/lib/turn/stun/message.js +180 -0
- package/dist/cjs/lib/turn/turn/auth.d.ts +1 -0
- package/dist/cjs/lib/turn/turn/auth.js +9 -0
- package/dist/cjs/lib/turn/turn/frame.d.ts +13 -0
- package/dist/cjs/lib/turn/turn/frame.js +68 -0
- package/dist/cjs/lib/turn/turn/protocol.d.ts +147 -0
- package/dist/cjs/lib/turn/turn/protocol.js +785 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/peer/Endpoints.d.ts +75 -0
- package/dist/cjs/peer/Endpoints.js +154 -0
- package/dist/cjs/peer/EngineConfig.d.ts +20 -0
- package/dist/cjs/peer/EngineConfig.js +36 -0
- package/dist/cjs/peer/EngineConnection.d.ts +22 -0
- package/dist/cjs/peer/EngineConnection.js +27 -0
- package/dist/cjs/peer/Events.d.ts +55 -0
- package/dist/cjs/peer/Events.js +85 -0
- package/dist/cjs/peer/MediaCodecs.d.ts +27 -0
- package/dist/cjs/peer/MediaCodecs.js +53 -0
- package/dist/cjs/peer/MediaTrack.d.ts +212 -0
- package/dist/cjs/peer/MediaTrack.js +313 -0
- package/dist/cjs/peer/PeerChannel.d.ts +248 -0
- package/dist/cjs/peer/PeerChannel.js +319 -0
- package/dist/cjs/peer/PeerConnection.d.ts +603 -0
- package/dist/cjs/peer/PeerConnection.js +697 -0
- package/dist/cjs/peer/PeerThreadChannel.d.ts +112 -0
- package/dist/cjs/peer/PeerThreadChannel.js +273 -0
- package/dist/cjs/peer/PeerThreadProtocol.d.ts +325 -0
- package/dist/cjs/peer/PeerThreadProtocol.js +2 -0
- package/dist/cjs/peer/PeerThreads.d.ts +114 -0
- package/dist/cjs/peer/PeerThreads.js +268 -0
- package/dist/cjs/peer/PeerWorker.d.ts +6 -0
- package/dist/cjs/peer/PeerWorker.js +461 -0
- package/dist/cjs/peer/PeerWorkerCode.d.ts +5 -0
- package/dist/cjs/peer/PeerWorkerCode.js +4 -0
- package/dist/cjs/peer/RemoteConnection.d.ts +314 -0
- package/dist/cjs/peer/RemoteConnection.js +913 -0
- package/dist/cjs/peer/RtpPacket.d.ts +112 -0
- package/dist/cjs/peer/RtpPacket.js +92 -0
- package/dist/cjs/peer/RtpTransceiver.d.ts +167 -0
- package/dist/cjs/peer/RtpTransceiver.js +235 -0
- package/dist/cjs/peer/SignalingClient.d.ts +236 -0
- package/dist/cjs/peer/SignalingClient.js +285 -0
- package/dist/cjs/protocol/SignalingProtocol.d.ts +266 -0
- package/dist/cjs/protocol/SignalingProtocol.js +65 -0
- package/dist/cjs/service/WebRTCServiceEntrypoint.d.ts +158 -0
- package/dist/cjs/service/WebRTCServiceEntrypoint.js +356 -0
- package/dist/cjs/sfu/SFU.d.ts +356 -0
- package/dist/cjs/sfu/SFU.js +763 -0
- package/dist/cjs/sfu/SFUAccess.d.ts +48 -0
- package/dist/cjs/sfu/SFUAccess.js +15 -0
- package/dist/cjs/sfu/SFUClusterLeg.d.ts +101 -0
- package/dist/cjs/sfu/SFUClusterLeg.js +106 -0
- package/dist/cjs/sfu/SFURoom.d.ts +148 -0
- package/dist/cjs/sfu/SFURoom.js +1300 -0
- package/dist/cjs/sfu/SFUWorker.d.ts +13 -0
- package/dist/cjs/sfu/SFUWorker.js +168 -0
- package/dist/cjs/sfu/SFUWorkerChannel.d.ts +204 -0
- package/dist/cjs/sfu/SFUWorkerChannel.js +105 -0
- package/dist/cjs/sfu/SFUWorkerCode.d.ts +5 -0
- package/dist/cjs/sfu/SFUWorkerCode.js +4 -0
- package/dist/cjs/sfu/SFUWorkers.d.ts +247 -0
- package/dist/cjs/sfu/SFUWorkers.js +552 -0
- package/dist/cjs/shared/ChunkedChannel.d.ts +122 -0
- package/dist/cjs/shared/ChunkedChannel.js +182 -0
- package/dist/cjs/shared/Connections.d.ts +231 -0
- package/dist/cjs/shared/Connections.js +2 -0
- package/dist/cjs/shared/Emitter.d.ts +50 -0
- package/dist/cjs/shared/Emitter.js +80 -0
- package/dist/cjs/shared/Peer.d.ts +182 -0
- package/dist/cjs/shared/Peer.js +509 -0
- package/dist/cjs/shared/PeerServiceProxy.d.ts +173 -0
- package/dist/cjs/shared/PeerServiceProxy.js +304 -0
- package/dist/cjs/shared/Room.d.ts +143 -0
- package/dist/cjs/shared/Room.js +515 -0
- package/dist/cjs/shared/SignalingError.d.ts +40 -0
- package/dist/cjs/shared/SignalingError.js +48 -0
- package/dist/cjs/shared/SignalingSession.d.ts +97 -0
- package/dist/cjs/shared/SignalingSession.js +347 -0
- package/dist/cjs/shared/Transports.d.ts +139 -0
- package/dist/cjs/shared/Transports.js +285 -0
- package/dist/cjs/signaling/MediaServers.d.ts +40 -0
- package/dist/cjs/signaling/MediaServers.js +16 -0
- package/dist/cjs/signaling/Signaling.d.ts +573 -0
- package/dist/cjs/signaling/Signaling.js +945 -0
- package/dist/cjs/signaling/SignalingController.d.ts +128 -0
- package/dist/cjs/signaling/SignalingController.js +229 -0
- package/dist/cjs/turn/TURNCredentials.d.ts +49 -0
- package/dist/cjs/turn/TURNCredentials.js +49 -0
- package/dist/cjs/turn/TURNIceServers.d.ts +11 -0
- package/dist/cjs/turn/TURNIceServers.js +25 -0
- package/dist/cjs/turn/TURNServer.d.ts +309 -0
- package/dist/cjs/turn/TURNServer.js +331 -0
- package/dist/cjs/turn/TURNWorker.d.ts +42 -0
- package/dist/cjs/turn/TURNWorker.js +52 -0
- package/dist/cjs/turn/TURNWorkerCode.d.ts +5 -0
- package/dist/cjs/turn/TURNWorkerCode.js +4 -0
- package/dist/cjs/turn/TURNWorkers.d.ts +52 -0
- package/dist/cjs/turn/TURNWorkers.js +211 -0
- package/dist/cjs/whep/WHEP.d.ts +386 -0
- package/dist/cjs/whep/WHEP.js +426 -0
- package/dist/cjs/whep/WHEPController.d.ts +134 -0
- package/dist/cjs/whep/WHEPController.js +301 -0
- package/dist/cjs/whip/WHIP.d.ts +426 -0
- package/dist/cjs/whip/WHIP.js +470 -0
- package/dist/cjs/whip/WHIPController.d.ts +132 -0
- package/dist/cjs/whip/WHIPController.js +299 -0
- package/dist/esm/client/SignalingConnection.js +63 -0
- package/dist/esm/cluster/Cluster.js +542 -0
- package/dist/esm/cluster/ClusterFrames.js +85 -0
- package/dist/esm/cluster/ClusterTURN.js +73 -0
- package/dist/esm/cluster/Rendezvous.js +20 -0
- package/dist/esm/cluster/transports/ClusterTransport.js +1 -0
- package/dist/esm/cluster/transports/LoadClient.js +44 -0
- package/dist/esm/cluster/transports/MemoryClusterTransport.js +43 -0
- package/dist/esm/cluster/transports/NATSClusterTransport.js +66 -0
- package/dist/esm/cluster/transports/RedisClusterTransport.js +73 -0
- package/dist/esm/exceptions/ClusterRequestException.js +14 -0
- package/dist/esm/exceptions/ClusterTimeoutException.js +13 -0
- package/dist/esm/exceptions/ClusterTransportNotFoundException.js +14 -0
- package/dist/esm/exceptions/SignalingClientRequiredException.js +15 -0
- package/dist/esm/exceptions/SignalingConnectionException.js +15 -0
- package/dist/esm/exceptions/SignalingDeniedException.js +14 -0
- package/dist/esm/exceptions/SignalingLimitException.js +14 -0
- package/dist/esm/exceptions/SignalingNotAMemberException.js +14 -0
- package/dist/esm/exceptions/WHEPDeniedException.js +18 -0
- package/dist/esm/exceptions/WHEPLimitException.js +18 -0
- package/dist/esm/exceptions/WHEPMediaTypeException.js +18 -0
- package/dist/esm/exceptions/WHEPOfferException.js +19 -0
- package/dist/esm/exceptions/WHEPSessionNotFoundException.js +18 -0
- package/dist/esm/exceptions/WHIPDeniedException.js +18 -0
- package/dist/esm/exceptions/WHIPLimitException.js +18 -0
- package/dist/esm/exceptions/WHIPMediaTypeException.js +18 -0
- package/dist/esm/exceptions/WHIPOfferException.js +19 -0
- package/dist/esm/exceptions/WHIPSessionNotFoundException.js +18 -0
- package/dist/esm/exports/Client.js +5 -0
- package/dist/esm/exports/WebRTC.js +41 -0
- package/dist/esm/lib/common/binary.js +244 -0
- package/dist/esm/lib/common/binaryData.js +392 -0
- package/dist/esm/lib/common/crc.js +118 -0
- package/dist/esm/lib/common/deque.js +85 -0
- package/dist/esm/lib/common/event.js +202 -0
- package/dist/esm/lib/common/index.js +11 -0
- package/dist/esm/lib/common/log.js +55 -0
- package/dist/esm/lib/common/network.js +52 -0
- package/dist/esm/lib/common/number.js +31 -0
- package/dist/esm/lib/common/promise.js +64 -0
- package/dist/esm/lib/common/transport.js +401 -0
- package/dist/esm/lib/common/type.js +1 -0
- package/dist/esm/lib/dtls/cipher/const.js +30 -0
- package/dist/esm/lib/dtls/cipher/create.js +98 -0
- package/dist/esm/lib/dtls/cipher/ec.js +37 -0
- package/dist/esm/lib/dtls/cipher/key-exchange.js +103 -0
- package/dist/esm/lib/dtls/cipher/namedCurve.js +24 -0
- package/dist/esm/lib/dtls/cipher/prf.js +79 -0
- package/dist/esm/lib/dtls/cipher/suites/abstract.js +37 -0
- package/dist/esm/lib/dtls/cipher/suites/aead.js +96 -0
- package/dist/esm/lib/dtls/cipher/suites/null.js +35 -0
- package/dist/esm/lib/dtls/cipher/utils.js +34 -0
- package/dist/esm/lib/dtls/cipher/x509.js +94 -0
- package/dist/esm/lib/dtls/client.js +72 -0
- package/dist/esm/lib/dtls/context/cipher.js +83 -0
- package/dist/esm/lib/dtls/context/dtls.js +45 -0
- package/dist/esm/lib/dtls/context/srtp.js +8 -0
- package/dist/esm/lib/dtls/context/transport.js +13 -0
- package/dist/esm/lib/dtls/flight/client/flight1.js +22 -0
- package/dist/esm/lib/dtls/flight/client/flight3.js +21 -0
- package/dist/esm/lib/dtls/flight/client/flight5.js +202 -0
- package/dist/esm/lib/dtls/flight/flight.js +64 -0
- package/dist/esm/lib/dtls/flight/server/flight2.js +122 -0
- package/dist/esm/lib/dtls/flight/server/flight4.js +83 -0
- package/dist/esm/lib/dtls/flight/server/flight6.js +107 -0
- package/dist/esm/lib/dtls/handshake/binary.js +17 -0
- package/dist/esm/lib/dtls/handshake/const.js +14 -0
- package/dist/esm/lib/dtls/handshake/extensions/ellipticCurves.js +36 -0
- package/dist/esm/lib/dtls/handshake/extensions/extendedMasterSecret.js +3 -0
- package/dist/esm/lib/dtls/handshake/extensions/renegotiationIndication.js +30 -0
- package/dist/esm/lib/dtls/handshake/extensions/signature.js +35 -0
- package/dist/esm/lib/dtls/handshake/extensions/useSrtp.js +61 -0
- package/dist/esm/lib/dtls/handshake/message/alert.js +20 -0
- package/dist/esm/lib/dtls/handshake/message/certificate.js +31 -0
- package/dist/esm/lib/dtls/handshake/message/changeCipherSpec.js +20 -0
- package/dist/esm/lib/dtls/handshake/message/client/certificateVerify.js +31 -0
- package/dist/esm/lib/dtls/handshake/message/client/hello.js +44 -0
- package/dist/esm/lib/dtls/handshake/message/client/keyExchange.js +29 -0
- package/dist/esm/lib/dtls/handshake/message/finished.js +22 -0
- package/dist/esm/lib/dtls/handshake/message/server/certificateRequest.js +34 -0
- package/dist/esm/lib/dtls/handshake/message/server/hello.js +53 -0
- package/dist/esm/lib/dtls/handshake/message/server/helloDone.js +26 -0
- package/dist/esm/lib/dtls/handshake/message/server/helloVerifyRequest.js +38 -0
- package/dist/esm/lib/dtls/handshake/message/server/keyExchange.js +45 -0
- package/dist/esm/lib/dtls/handshake/random.js +25 -0
- package/dist/esm/lib/dtls/helper.js +23 -0
- package/dist/esm/lib/dtls/imports/common.js +1 -0
- package/dist/esm/lib/dtls/imports/rtp.js +1 -0
- package/dist/esm/lib/dtls/index.js +97 -0
- package/dist/esm/lib/dtls/record/antiReplayWindow.js +98 -0
- package/dist/esm/lib/dtls/record/builder.js +22 -0
- package/dist/esm/lib/dtls/record/const.js +35 -0
- package/dist/esm/lib/dtls/record/message/fragment.js +92 -0
- package/dist/esm/lib/dtls/record/message/header.js +30 -0
- package/dist/esm/lib/dtls/record/message/plaintext.js +59 -0
- package/dist/esm/lib/dtls/record/receive.js +86 -0
- package/dist/esm/lib/dtls/server.js +74 -0
- package/dist/esm/lib/dtls/socket.js +184 -0
- package/dist/esm/lib/dtls/typings/domain.js +1 -0
- package/dist/esm/lib/dtls/util/binary.js +5 -0
- package/dist/esm/lib/ice/candidate.js +190 -0
- package/dist/esm/lib/ice/dns/lookup.js +95 -0
- package/dist/esm/lib/ice/dns/mdns.js +139 -0
- package/dist/esm/lib/ice/exceptions.js +34 -0
- package/dist/esm/lib/ice/helper.js +65 -0
- package/dist/esm/lib/ice/ice.js +1547 -0
- package/dist/esm/lib/ice/iceBase.js +172 -0
- package/dist/esm/lib/ice/imports/common.js +1 -0
- package/dist/esm/lib/ice/index.js +12 -0
- package/dist/esm/lib/ice/internal/selectAddresses.js +36 -0
- package/dist/esm/lib/ice/stun/attributes.js +1 -0
- package/dist/esm/lib/ice/stun/const.js +8 -0
- package/dist/esm/lib/ice/stun/message.js +1 -0
- package/dist/esm/lib/ice/stun/protocol.js +121 -0
- package/dist/esm/lib/ice/stun/tcpFrame.js +21 -0
- package/dist/esm/lib/ice/stun/tcpProtocol.js +318 -0
- package/dist/esm/lib/ice/stun/transaction.js +230 -0
- package/dist/esm/lib/ice/turn/frame.js +1 -0
- package/dist/esm/lib/ice/turn/protocol.js +630 -0
- package/dist/esm/lib/ice/types/model.js +1 -0
- package/dist/esm/lib/ice/utils.js +43 -0
- package/dist/esm/lib/peer/const.js +50 -0
- package/dist/esm/lib/peer/dataChannel.js +127 -0
- package/dist/esm/lib/peer/errors.js +17 -0
- package/dist/esm/lib/peer/helper.js +77 -0
- package/dist/esm/lib/peer/imports/common.js +1 -0
- package/dist/esm/lib/peer/imports/dtls.js +1 -0
- package/dist/esm/lib/peer/imports/ice.js +1 -0
- package/dist/esm/lib/peer/imports/rtp.js +1 -0
- package/dist/esm/lib/peer/index.js +14 -0
- package/dist/esm/lib/peer/media/codec.js +69 -0
- package/dist/esm/lib/peer/media/codecCompatibility.js +128 -0
- package/dist/esm/lib/peer/media/extension/rtcpFeedback.js +5 -0
- package/dist/esm/lib/peer/media/extension/rtpExtension.js +42 -0
- package/dist/esm/lib/peer/media/index.js +12 -0
- package/dist/esm/lib/peer/media/parameters.js +50 -0
- package/dist/esm/lib/peer/media/receiver/nack.js +100 -0
- package/dist/esm/lib/peer/media/receiver/receiverTwcc.js +175 -0
- package/dist/esm/lib/peer/media/receiver/statistics.js +67 -0
- package/dist/esm/lib/peer/media/router.js +162 -0
- package/dist/esm/lib/peer/media/rtpReceiver.js +403 -0
- package/dist/esm/lib/peer/media/rtpSender.js +822 -0
- package/dist/esm/lib/peer/media/rtpTransceiver.js +241 -0
- package/dist/esm/lib/peer/media/sender/cumulativeResult.js +57 -0
- package/dist/esm/lib/peer/media/sender/senderBWE.js +95 -0
- package/dist/esm/lib/peer/media/stats.js +81 -0
- package/dist/esm/lib/peer/media/track.js +208 -0
- package/dist/esm/lib/peer/peerConnection.js +1585 -0
- package/dist/esm/lib/peer/sctpManager.js +134 -0
- package/dist/esm/lib/peer/sdp.js +614 -0
- package/dist/esm/lib/peer/sdpManager.js +569 -0
- package/dist/esm/lib/peer/secureTransportManager.js +468 -0
- package/dist/esm/lib/peer/transceiverManager.js +763 -0
- package/dist/esm/lib/peer/transport/dtls.js +564 -0
- package/dist/esm/lib/peer/transport/ice.js +426 -0
- package/dist/esm/lib/peer/transport/sctp.js +382 -0
- package/dist/esm/lib/peer/types/domain.js +16 -0
- package/dist/esm/lib/peer/types/util.js +1 -0
- package/dist/esm/lib/peer/utils.js +286 -0
- package/dist/esm/lib/rtp/codec/av1.js +203 -0
- package/dist/esm/lib/rtp/codec/base.js +11 -0
- package/dist/esm/lib/rtp/codec/h264.js +118 -0
- package/dist/esm/lib/rtp/codec/index.js +66 -0
- package/dist/esm/lib/rtp/codec/leb128.js +20 -0
- package/dist/esm/lib/rtp/codec/opus.js +21 -0
- package/dist/esm/lib/rtp/codec/vp8.js +105 -0
- package/dist/esm/lib/rtp/codec/vp9.js +157 -0
- package/dist/esm/lib/rtp/const.js +1 -0
- package/dist/esm/lib/rtp/helper.js +29 -0
- package/dist/esm/lib/rtp/imports/common.js +1 -0
- package/dist/esm/lib/rtp/index.js +25 -0
- package/dist/esm/lib/rtp/rtcp/header.js +46 -0
- package/dist/esm/lib/rtp/rtcp/psfb/fullIntraRequest.js +30 -0
- package/dist/esm/lib/rtp/rtcp/psfb/index.js +35 -0
- package/dist/esm/lib/rtp/rtcp/psfb/pictureLossIndication.js +16 -0
- package/dist/esm/lib/rtp/rtcp/psfb/remb.js +49 -0
- package/dist/esm/lib/rtp/rtcp/rr.js +68 -0
- package/dist/esm/lib/rtp/rtcp/rtcp.js +53 -0
- package/dist/esm/lib/rtp/rtcp/rtpfb/const.js +1 -0
- package/dist/esm/lib/rtp/rtcp/rtpfb/index.js +31 -0
- package/dist/esm/lib/rtp/rtcp/rtpfb/nack.js +73 -0
- package/dist/esm/lib/rtp/rtcp/rtpfb/twcc.js +344 -0
- package/dist/esm/lib/rtp/rtcp/sdes.js +91 -0
- package/dist/esm/lib/rtp/rtcp/sr.js +104 -0
- package/dist/esm/lib/rtp/rtp/headerExtension.js +102 -0
- package/dist/esm/lib/rtp/rtp/red/encoder.js +40 -0
- package/dist/esm/lib/rtp/rtp/red/handler.js +55 -0
- package/dist/esm/lib/rtp/rtp/red/packet.js +107 -0
- package/dist/esm/lib/rtp/rtp/rtp.js +266 -0
- package/dist/esm/lib/rtp/rtp/rtx.js +25 -0
- package/dist/esm/lib/rtp/srtp/cipher/ctr.js +103 -0
- package/dist/esm/lib/rtp/srtp/cipher/gcm.js +141 -0
- package/dist/esm/lib/rtp/srtp/cipher/index.js +20 -0
- package/dist/esm/lib/rtp/srtp/const.js +21 -0
- package/dist/esm/lib/rtp/srtp/context/context.js +175 -0
- package/dist/esm/lib/rtp/srtp/context/srtcp.js +21 -0
- package/dist/esm/lib/rtp/srtp/context/srtp.js +37 -0
- package/dist/esm/lib/rtp/srtp/error.js +6 -0
- package/dist/esm/lib/rtp/srtp/packet.js +42 -0
- package/dist/esm/lib/rtp/srtp/session.js +9 -0
- package/dist/esm/lib/rtp/srtp/srtcp.js +17 -0
- package/dist/esm/lib/rtp/srtp/srtp.js +16 -0
- package/dist/esm/lib/rtp/transport.js +18 -0
- package/dist/esm/lib/rtp/util.js +24 -0
- package/dist/esm/lib/sctp/chunk.js +515 -0
- package/dist/esm/lib/sctp/const.js +19 -0
- package/dist/esm/lib/sctp/helper.js +10 -0
- package/dist/esm/lib/sctp/imports/common.js +1 -0
- package/dist/esm/lib/sctp/index.js +4 -0
- package/dist/esm/lib/sctp/param.js +126 -0
- package/dist/esm/lib/sctp/sctp.js +1459 -0
- package/dist/esm/lib/sctp/transport.js +23 -0
- package/dist/esm/lib/turn/index.js +9 -0
- package/dist/esm/lib/turn/node/server.js +89 -0
- package/dist/esm/lib/turn/node/turnServer.js +560 -0
- package/dist/esm/lib/turn/protocol.js +112 -0
- package/dist/esm/lib/turn/stun/attributes.js +198 -0
- package/dist/esm/lib/turn/stun/const.js +82 -0
- package/dist/esm/lib/turn/stun/ip.js +81 -0
- package/dist/esm/lib/turn/stun/message.js +174 -0
- package/dist/esm/lib/turn/turn/auth.js +6 -0
- package/dist/esm/lib/turn/turn/frame.js +61 -0
- package/dist/esm/lib/turn/turn/protocol.js +781 -0
- package/dist/esm/peer/Endpoints.js +143 -0
- package/dist/esm/peer/EngineConfig.js +33 -0
- package/dist/esm/peer/EngineConnection.js +22 -0
- package/dist/esm/peer/Events.js +81 -0
- package/dist/esm/peer/MediaCodecs.js +47 -0
- package/dist/esm/peer/MediaTrack.js +305 -0
- package/dist/esm/peer/PeerChannel.js +315 -0
- package/dist/esm/peer/PeerConnection.js +694 -0
- package/dist/esm/peer/PeerThreadChannel.js +266 -0
- package/dist/esm/peer/PeerThreadProtocol.js +1 -0
- package/dist/esm/peer/PeerThreads.js +264 -0
- package/dist/esm/peer/PeerWorker.js +458 -0
- package/dist/esm/peer/PeerWorkerCode.js +1 -0
- package/dist/esm/peer/RemoteConnection.js +905 -0
- package/dist/esm/peer/RtpPacket.js +86 -0
- package/dist/esm/peer/RtpTransceiver.js +225 -0
- package/dist/esm/peer/SignalingClient.js +249 -0
- package/dist/esm/protocol/SignalingProtocol.js +62 -0
- package/dist/esm/service/WebRTCServiceEntrypoint.js +352 -0
- package/dist/esm/sfu/SFU.js +759 -0
- package/dist/esm/sfu/SFUAccess.js +12 -0
- package/dist/esm/sfu/SFUClusterLeg.js +102 -0
- package/dist/esm/sfu/SFURoom.js +1296 -0
- package/dist/esm/sfu/SFUWorker.js +165 -0
- package/dist/esm/sfu/SFUWorkerChannel.js +101 -0
- package/dist/esm/sfu/SFUWorkerCode.js +1 -0
- package/dist/esm/sfu/SFUWorkers.js +547 -0
- package/dist/esm/shared/ChunkedChannel.js +178 -0
- package/dist/esm/shared/Connections.js +1 -0
- package/dist/esm/shared/Emitter.js +76 -0
- package/dist/esm/shared/Peer.js +505 -0
- package/dist/esm/shared/PeerServiceProxy.js +299 -0
- package/dist/esm/shared/Room.js +511 -0
- package/dist/esm/shared/SignalingError.js +43 -0
- package/dist/esm/shared/SignalingSession.js +343 -0
- package/dist/esm/shared/Transports.js +279 -0
- package/dist/esm/signaling/MediaServers.js +13 -0
- package/dist/esm/signaling/Signaling.js +941 -0
- package/dist/esm/signaling/SignalingController.js +225 -0
- package/dist/esm/turn/TURNCredentials.js +44 -0
- package/dist/esm/turn/TURNIceServers.js +22 -0
- package/dist/esm/turn/TURNServer.js +327 -0
- package/dist/esm/turn/TURNWorker.js +49 -0
- package/dist/esm/turn/TURNWorkerCode.js +1 -0
- package/dist/esm/turn/TURNWorkers.js +206 -0
- package/dist/esm/whep/WHEP.js +422 -0
- package/dist/esm/whep/WHEPController.js +298 -0
- package/dist/esm/whip/WHIP.js +466 -0
- package/dist/esm/whip/WHIPController.js +296 -0
- package/dist/types/client/SignalingConnection.d.ts +81 -0
- package/dist/types/cluster/Cluster.d.ts +503 -0
- package/dist/types/cluster/ClusterFrames.d.ts +24 -0
- package/dist/types/cluster/ClusterTURN.d.ts +63 -0
- package/dist/types/cluster/Rendezvous.d.ts +8 -0
- package/dist/types/cluster/transports/ClusterTransport.d.ts +34 -0
- package/dist/types/cluster/transports/LoadClient.d.ts +6 -0
- package/dist/types/cluster/transports/MemoryClusterTransport.d.ts +13 -0
- package/dist/types/cluster/transports/NATSClusterTransport.d.ts +23 -0
- package/dist/types/cluster/transports/RedisClusterTransport.d.ts +23 -0
- package/dist/types/exceptions/ClusterRequestException.d.ts +11 -0
- package/dist/types/exceptions/ClusterTimeoutException.d.ts +10 -0
- package/dist/types/exceptions/ClusterTransportNotFoundException.d.ts +11 -0
- package/dist/types/exceptions/SignalingClientRequiredException.d.ts +12 -0
- package/dist/types/exceptions/SignalingConnectionException.d.ts +12 -0
- package/dist/types/exceptions/SignalingDeniedException.d.ts +11 -0
- package/dist/types/exceptions/SignalingLimitException.d.ts +11 -0
- package/dist/types/exceptions/SignalingNotAMemberException.d.ts +11 -0
- package/dist/types/exceptions/WHEPDeniedException.d.ts +15 -0
- package/dist/types/exceptions/WHEPLimitException.d.ts +15 -0
- package/dist/types/exceptions/WHEPMediaTypeException.d.ts +15 -0
- package/dist/types/exceptions/WHEPOfferException.d.ts +16 -0
- package/dist/types/exceptions/WHEPSessionNotFoundException.d.ts +15 -0
- package/dist/types/exceptions/WHIPDeniedException.d.ts +15 -0
- package/dist/types/exceptions/WHIPLimitException.d.ts +15 -0
- package/dist/types/exceptions/WHIPMediaTypeException.d.ts +15 -0
- package/dist/types/exceptions/WHIPOfferException.d.ts +16 -0
- package/dist/types/exceptions/WHIPSessionNotFoundException.d.ts +15 -0
- package/dist/types/exports/Client.d.ts +11 -0
- package/dist/types/exports/WebRTC.d.ts +48 -0
- package/dist/types/lib/common/binary.d.ts +51 -0
- package/dist/types/lib/common/binaryData.d.ts +116 -0
- package/dist/types/lib/common/crc.d.ts +4 -0
- package/dist/types/lib/common/deque.d.ts +36 -0
- package/dist/types/lib/common/event.d.ts +48 -0
- package/dist/types/lib/common/index.d.ts +11 -0
- package/dist/types/lib/common/log.d.ts +47 -0
- package/dist/types/lib/common/network.d.ts +10 -0
- package/dist/types/lib/common/number.d.ts +13 -0
- package/dist/types/lib/common/promise.d.ts +21 -0
- package/dist/types/lib/common/transport.d.ts +104 -0
- package/dist/types/lib/common/type.d.ts +3 -0
- package/dist/types/lib/dtls/cipher/const.d.ts +42 -0
- package/dist/types/lib/dtls/cipher/create.d.ts +21 -0
- package/dist/types/lib/dtls/cipher/ec.d.ts +28 -0
- package/dist/types/lib/dtls/cipher/key-exchange.d.ts +43 -0
- package/dist/types/lib/dtls/cipher/namedCurve.d.ts +7 -0
- package/dist/types/lib/dtls/cipher/prf.d.ts +17 -0
- package/dist/types/lib/dtls/cipher/suites/abstract.d.ts +40 -0
- package/dist/types/lib/dtls/cipher/suites/aead.d.ts +28 -0
- package/dist/types/lib/dtls/cipher/suites/null.d.ts +24 -0
- package/dist/types/lib/dtls/cipher/utils.d.ts +18 -0
- package/dist/types/lib/dtls/cipher/x509.d.ts +33 -0
- package/dist/types/lib/dtls/client.d.ts +7 -0
- package/dist/types/lib/dtls/context/cipher.d.ts +42 -0
- package/dist/types/lib/dtls/context/dtls.d.ts +38 -0
- package/dist/types/lib/dtls/context/srtp.d.ts +5 -0
- package/dist/types/lib/dtls/context/transport.d.ts +8 -0
- package/dist/types/lib/dtls/flight/client/flight1.d.ts +10 -0
- package/dist/types/lib/dtls/flight/client/flight3.d.ts +8 -0
- package/dist/types/lib/dtls/flight/client/flight5.d.ts +18 -0
- package/dist/types/lib/dtls/flight/flight.d.ts +18 -0
- package/dist/types/lib/dtls/flight/server/flight2.d.ts +6 -0
- package/dist/types/lib/dtls/flight/server/flight4.d.ts +17 -0
- package/dist/types/lib/dtls/flight/server/flight6.d.ts +13 -0
- package/dist/types/lib/dtls/handshake/binary.d.ts +16 -0
- package/dist/types/lib/dtls/handshake/const.d.ts +13 -0
- package/dist/types/lib/dtls/handshake/extensions/ellipticCurves.d.ts +17 -0
- package/dist/types/lib/dtls/handshake/extensions/extendedMasterSecret.d.ts +3 -0
- package/dist/types/lib/dtls/handshake/extensions/renegotiationIndication.d.ts +18 -0
- package/dist/types/lib/dtls/handshake/extensions/signature.d.ts +26 -0
- package/dist/types/lib/dtls/handshake/extensions/useSrtp.d.ts +19 -0
- package/dist/types/lib/dtls/handshake/message/alert.d.ts +12 -0
- package/dist/types/lib/dtls/handshake/message/certificate.d.ts +17 -0
- package/dist/types/lib/dtls/handshake/message/changeCipherSpec.d.ts +11 -0
- package/dist/types/lib/dtls/handshake/message/client/certificateVerify.d.ts +20 -0
- package/dist/types/lib/dtls/handshake/message/client/hello.d.ts +50 -0
- package/dist/types/lib/dtls/handshake/message/client/keyExchange.d.ts +17 -0
- package/dist/types/lib/dtls/handshake/message/finished.d.ts +13 -0
- package/dist/types/lib/dtls/handshake/message/server/certificateRequest.d.ts +31 -0
- package/dist/types/lib/dtls/handshake/message/server/hello.d.ts +33 -0
- package/dist/types/lib/dtls/handshake/message/server/helloDone.d.ts +12 -0
- package/dist/types/lib/dtls/handshake/message/server/helloVerifyRequest.d.ts +32 -0
- package/dist/types/lib/dtls/handshake/message/server/keyExchange.d.ts +32 -0
- package/dist/types/lib/dtls/handshake/random.d.ts +13 -0
- package/dist/types/lib/dtls/helper.d.ts +4 -0
- package/dist/types/lib/dtls/imports/common.d.ts +1 -0
- package/dist/types/lib/dtls/imports/rtp.d.ts +1 -0
- package/dist/types/lib/dtls/index.d.ts +7 -0
- package/dist/types/lib/dtls/record/antiReplayWindow.d.ts +27 -0
- package/dist/types/lib/dtls/record/builder.d.ts +9 -0
- package/dist/types/lib/dtls/record/const.d.ts +33 -0
- package/dist/types/lib/dtls/record/message/fragment.d.ts +26 -0
- package/dist/types/lib/dtls/record/message/header.d.ts +38 -0
- package/dist/types/lib/dtls/record/message/plaintext.d.ts +14 -0
- package/dist/types/lib/dtls/record/receive.d.ts +9 -0
- package/dist/types/lib/dtls/server.d.ts +6 -0
- package/dist/types/lib/dtls/socket.d.ts +52 -0
- package/dist/types/lib/dtls/typings/domain.d.ts +20 -0
- package/dist/types/lib/dtls/util/binary.d.ts +2 -0
- package/dist/types/lib/ice/candidate.d.ts +35 -0
- package/dist/types/lib/ice/dns/lookup.d.ts +16 -0
- package/dist/types/lib/ice/dns/mdns.d.ts +38 -0
- package/dist/types/lib/ice/exceptions.d.ts +24 -0
- package/dist/types/lib/ice/helper.d.ts +17 -0
- package/dist/types/lib/ice/ice.d.ts +182 -0
- package/dist/types/lib/ice/iceBase.d.ts +214 -0
- package/dist/types/lib/ice/imports/common.d.ts +1 -0
- package/dist/types/lib/ice/index.d.ts +12 -0
- package/dist/types/lib/ice/internal/selectAddresses.d.ts +9 -0
- package/dist/types/lib/ice/stun/attributes.d.ts +1 -0
- package/dist/types/lib/ice/stun/const.d.ts +8 -0
- package/dist/types/lib/ice/stun/message.d.ts +1 -0
- package/dist/types/lib/ice/stun/protocol.d.ts +30 -0
- package/dist/types/lib/ice/stun/tcpFrame.d.ts +5 -0
- package/dist/types/lib/ice/stun/tcpProtocol.d.ts +57 -0
- package/dist/types/lib/ice/stun/transaction.d.ts +75 -0
- package/dist/types/lib/ice/turn/frame.d.ts +1 -0
- package/dist/types/lib/ice/turn/protocol.d.ts +170 -0
- package/dist/types/lib/ice/types/model.d.ts +56 -0
- package/dist/types/lib/ice/utils.d.ts +13 -0
- package/dist/types/lib/peer/const.d.ts +36 -0
- package/dist/types/lib/peer/dataChannel.d.ts +69 -0
- package/dist/types/lib/peer/errors.d.ts +11 -0
- package/dist/types/lib/peer/helper.d.ts +20 -0
- package/dist/types/lib/peer/imports/common.d.ts +1 -0
- package/dist/types/lib/peer/imports/dtls.d.ts +1 -0
- package/dist/types/lib/peer/imports/ice.d.ts +1 -0
- package/dist/types/lib/peer/imports/rtp.d.ts +1 -0
- package/dist/types/lib/peer/index.d.ts +14 -0
- package/dist/types/lib/peer/media/codec.d.ts +15 -0
- package/dist/types/lib/peer/media/codecCompatibility.d.ts +23 -0
- package/dist/types/lib/peer/media/extension/rtcpFeedback.d.ts +6 -0
- package/dist/types/lib/peer/media/extension/rtpExtension.d.ts +9 -0
- package/dist/types/lib/peer/media/index.d.ts +12 -0
- package/dist/types/lib/peer/media/parameters.d.ts +65 -0
- package/dist/types/lib/peer/media/receiver/nack.d.ts +23 -0
- package/dist/types/lib/peer/media/receiver/receiverTwcc.d.ts +47 -0
- package/dist/types/lib/peer/media/receiver/statistics.d.ts +22 -0
- package/dist/types/lib/peer/media/router.d.ts +25 -0
- package/dist/types/lib/peer/media/rtpReceiver.d.ts +90 -0
- package/dist/types/lib/peer/media/rtpSender.d.ts +209 -0
- package/dist/types/lib/peer/media/rtpTransceiver.d.ts +117 -0
- package/dist/types/lib/peer/media/sender/cumulativeResult.d.ts +19 -0
- package/dist/types/lib/peer/media/sender/senderBWE.d.ts +32 -0
- package/dist/types/lib/peer/media/stats.d.ts +293 -0
- package/dist/types/lib/peer/media/track.d.ts +67 -0
- package/dist/types/lib/peer/peerConnection.d.ts +458 -0
- package/dist/types/lib/peer/sctpManager.d.ts +28 -0
- package/dist/types/lib/peer/sdp.d.ts +97 -0
- package/dist/types/lib/peer/sdpManager.d.ts +116 -0
- package/dist/types/lib/peer/secureTransportManager.d.ts +96 -0
- package/dist/types/lib/peer/transceiverManager.d.ts +151 -0
- package/dist/types/lib/peer/transport/dtls.d.ts +95 -0
- package/dist/types/lib/peer/transport/ice.d.ts +143 -0
- package/dist/types/lib/peer/transport/sctp.d.ts +56 -0
- package/dist/types/lib/peer/types/domain.d.ts +5 -0
- package/dist/types/lib/peer/types/util.d.ts +2 -0
- package/dist/types/lib/peer/utils.d.ts +73 -0
- package/dist/types/lib/rtp/codec/av1.d.ts +56 -0
- package/dist/types/lib/rtp/codec/base.d.ts +8 -0
- package/dist/types/lib/rtp/codec/h264.d.ts +32 -0
- package/dist/types/lib/rtp/codec/index.d.ts +16 -0
- package/dist/types/lib/rtp/codec/leb128.d.ts +5 -0
- package/dist/types/lib/rtp/codec/opus.d.ts +9 -0
- package/dist/types/lib/rtp/codec/vp8.d.ts +27 -0
- package/dist/types/lib/rtp/codec/vp9.d.ts +46 -0
- package/dist/types/lib/rtp/const.d.ts +1 -0
- package/dist/types/lib/rtp/helper.d.ts +8 -0
- package/dist/types/lib/rtp/imports/common.d.ts +1 -0
- package/dist/types/lib/rtp/index.d.ts +25 -0
- package/dist/types/lib/rtp/rtcp/header.d.ts +13 -0
- package/dist/types/lib/rtp/rtcp/psfb/fullIntraRequest.d.ts +16 -0
- package/dist/types/lib/rtp/rtcp/psfb/index.d.ts +14 -0
- package/dist/types/lib/rtp/rtcp/psfb/pictureLossIndication.d.ts +10 -0
- package/dist/types/lib/rtp/rtcp/psfb/remb.d.ts +16 -0
- package/dist/types/lib/rtp/rtcp/rr.d.ts +32 -0
- package/dist/types/lib/rtp/rtcp/rtcp.d.ts +10 -0
- package/dist/types/lib/rtp/rtcp/rtpfb/const.d.ts +1 -0
- package/dist/types/lib/rtp/rtcp/rtpfb/index.d.ts +14 -0
- package/dist/types/lib/rtp/rtcp/rtpfb/nack.d.ts +17 -0
- package/dist/types/lib/rtp/rtcp/rtpfb/twcc.d.ts +71 -0
- package/dist/types/lib/rtp/rtcp/sdes.d.ts +26 -0
- package/dist/types/lib/rtp/rtcp/sr.d.ts +41 -0
- package/dist/types/lib/rtp/rtp/headerExtension.d.ts +72 -0
- package/dist/types/lib/rtp/rtp/red/encoder.d.ts +13 -0
- package/dist/types/lib/rtp/rtp/red/handler.d.ts +6 -0
- package/dist/types/lib/rtp/rtp/red/packet.d.ts +26 -0
- package/dist/types/lib/rtp/rtp/rtp.d.ts +44 -0
- package/dist/types/lib/rtp/rtp/rtx.d.ts +3 -0
- package/dist/types/lib/rtp/srtp/cipher/ctr.d.ts +16 -0
- package/dist/types/lib/rtp/srtp/cipher/gcm.d.ts +17 -0
- package/dist/types/lib/rtp/srtp/cipher/index.d.ts +13 -0
- package/dist/types/lib/rtp/srtp/const.d.ts +6 -0
- package/dist/types/lib/rtp/srtp/context/context.d.ts +45 -0
- package/dist/types/lib/rtp/srtp/context/srtcp.d.ts +8 -0
- package/dist/types/lib/rtp/srtp/context/srtp.d.ts +9 -0
- package/dist/types/lib/rtp/srtp/error.d.ts +3 -0
- package/dist/types/lib/rtp/srtp/packet.d.ts +5 -0
- package/dist/types/lib/rtp/srtp/session.d.ts +19 -0
- package/dist/types/lib/rtp/srtp/srtcp.d.ts +8 -0
- package/dist/types/lib/rtp/srtp/srtp.d.ts +9 -0
- package/dist/types/lib/rtp/transport.d.ts +15 -0
- package/dist/types/lib/rtp/util.d.ts +11 -0
- package/dist/types/lib/sctp/chunk.d.ts +164 -0
- package/dist/types/lib/sctp/const.d.ts +17 -0
- package/dist/types/lib/sctp/helper.d.ts +5 -0
- package/dist/types/lib/sctp/imports/common.d.ts +1 -0
- package/dist/types/lib/sctp/index.d.ts +6 -0
- package/dist/types/lib/sctp/param.d.ts +40 -0
- package/dist/types/lib/sctp/sctp.d.ts +210 -0
- package/dist/types/lib/sctp/transport.d.ts +15 -0
- package/dist/types/lib/turn/index.d.ts +9 -0
- package/dist/types/lib/turn/node/server.d.ts +21 -0
- package/dist/types/lib/turn/node/turnServer.d.ts +91 -0
- package/dist/types/lib/turn/protocol.d.ts +47 -0
- package/dist/types/lib/turn/stun/attributes.d.ts +37 -0
- package/dist/types/lib/turn/stun/const.d.ts +28 -0
- package/dist/types/lib/turn/stun/ip.d.ts +12 -0
- package/dist/types/lib/turn/stun/message.d.ts +37 -0
- package/dist/types/lib/turn/turn/auth.d.ts +1 -0
- package/dist/types/lib/turn/turn/frame.d.ts +13 -0
- package/dist/types/lib/turn/turn/protocol.d.ts +147 -0
- package/dist/types/peer/Endpoints.d.ts +75 -0
- package/dist/types/peer/EngineConfig.d.ts +20 -0
- package/dist/types/peer/EngineConnection.d.ts +22 -0
- package/dist/types/peer/Events.d.ts +55 -0
- package/dist/types/peer/MediaCodecs.d.ts +27 -0
- package/dist/types/peer/MediaTrack.d.ts +212 -0
- package/dist/types/peer/PeerChannel.d.ts +248 -0
- package/dist/types/peer/PeerConnection.d.ts +603 -0
- package/dist/types/peer/PeerThreadChannel.d.ts +112 -0
- package/dist/types/peer/PeerThreadProtocol.d.ts +325 -0
- package/dist/types/peer/PeerThreads.d.ts +114 -0
- package/dist/types/peer/PeerWorker.d.ts +6 -0
- package/dist/types/peer/PeerWorkerCode.d.ts +5 -0
- package/dist/types/peer/RemoteConnection.d.ts +314 -0
- package/dist/types/peer/RtpPacket.d.ts +112 -0
- package/dist/types/peer/RtpTransceiver.d.ts +167 -0
- package/dist/types/peer/SignalingClient.d.ts +236 -0
- package/dist/types/protocol/SignalingProtocol.d.ts +266 -0
- package/dist/types/service/WebRTCServiceEntrypoint.d.ts +158 -0
- package/dist/types/sfu/SFU.d.ts +356 -0
- package/dist/types/sfu/SFUAccess.d.ts +48 -0
- package/dist/types/sfu/SFUClusterLeg.d.ts +101 -0
- package/dist/types/sfu/SFURoom.d.ts +148 -0
- package/dist/types/sfu/SFUWorker.d.ts +13 -0
- package/dist/types/sfu/SFUWorkerChannel.d.ts +204 -0
- package/dist/types/sfu/SFUWorkerCode.d.ts +5 -0
- package/dist/types/sfu/SFUWorkers.d.ts +247 -0
- package/dist/types/shared/ChunkedChannel.d.ts +122 -0
- package/dist/types/shared/Connections.d.ts +231 -0
- package/dist/types/shared/Emitter.d.ts +50 -0
- package/dist/types/shared/Peer.d.ts +182 -0
- package/dist/types/shared/PeerServiceProxy.d.ts +173 -0
- package/dist/types/shared/Room.d.ts +143 -0
- package/dist/types/shared/SignalingError.d.ts +40 -0
- package/dist/types/shared/SignalingSession.d.ts +97 -0
- package/dist/types/shared/Transports.d.ts +139 -0
- package/dist/types/signaling/MediaServers.d.ts +40 -0
- package/dist/types/signaling/Signaling.d.ts +573 -0
- package/dist/types/signaling/SignalingController.d.ts +128 -0
- package/dist/types/turn/TURNCredentials.d.ts +49 -0
- package/dist/types/turn/TURNIceServers.d.ts +11 -0
- package/dist/types/turn/TURNServer.d.ts +309 -0
- package/dist/types/turn/TURNWorker.d.ts +42 -0
- package/dist/types/turn/TURNWorkerCode.d.ts +5 -0
- package/dist/types/turn/TURNWorkers.d.ts +52 -0
- package/dist/types/whep/WHEP.d.ts +386 -0
- package/dist/types/whep/WHEPController.d.ts +134 -0
- package/dist/types/whip/WHIP.d.ts +426 -0
- package/dist/types/whip/WHIPController.d.ts +132 -0
- package/package.json +115 -4
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare class WeriftError extends Error {
|
|
2
|
+
message: string;
|
|
3
|
+
payload?: object;
|
|
4
|
+
path?: string;
|
|
5
|
+
constructor(props: Pick<WeriftError, 'message' | 'payload' | 'path'>);
|
|
6
|
+
toJSON(): {
|
|
7
|
+
message: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
path: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Receives the debug messages of the WebRTC implementation: the namespace of the module (`webrtc/ice/ice`,
|
|
14
|
+
* `webrtc/sctp/sctp`…), then the arguments given to the logging function (a format string first, as with
|
|
15
|
+
* `util.format`). The messages of the worker threads of a media server or of a TURN server (`SFU` or `TURNServer` with
|
|
16
|
+
* `workers`) come already formatted, as one string starting with the number of the thread (`[thread 0] …`).
|
|
17
|
+
*/
|
|
18
|
+
export type DebugHandler = (namespace: string, args: unknown[]) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Told when a handler is set or removed (the worker threads of the media server and of the TURN server send their
|
|
21
|
+
* messages to the handler of the main thread while there is one)
|
|
22
|
+
*/
|
|
23
|
+
export declare const debugHandlerWatchers: Set<(set: boolean) => void>;
|
|
24
|
+
/**
|
|
25
|
+
* Whether a handler is set
|
|
26
|
+
*/
|
|
27
|
+
export declare function hasDebugHandler(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Send the debug messages of the WebRTC implementation (ICE, DTLS, SCTP, TURN), including those of the worker threads of
|
|
30
|
+
* a media server or of a TURN server, to a handler, to find out why a connection fails; they are dropped by default.
|
|
31
|
+
* @param handler The handler, or undefined to drop them again.
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* import {format} from 'node:util'
|
|
35
|
+
* import {setDebugHandler} from '@lakutata/webrtc'
|
|
36
|
+
*
|
|
37
|
+
* //The messages of ICE only
|
|
38
|
+
* setDebugHandler((namespace: string, args: unknown[]): void => {
|
|
39
|
+
* if (namespace.startsWith('webrtc/ice')) console.debug(namespace, format(...args))
|
|
40
|
+
* })
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function setDebugHandler(handler: DebugHandler | undefined): void;
|
|
44
|
+
/**
|
|
45
|
+
* The logging function of a module: it does nothing while no handler is set
|
|
46
|
+
*/
|
|
47
|
+
export declare function debug(namespace: string): (...args: unknown[]) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SocketType } from 'node:dgram';
|
|
2
|
+
export type InterfaceAddresses = {
|
|
3
|
+
[K in SocketType]?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const interfaceAddress: (type: SocketType, interfaceAddresses: InterfaceAddresses | undefined) => string | undefined;
|
|
6
|
+
export declare function randomPort(protocol?: SocketType, interfaceAddresses?: InterfaceAddresses): Promise<number>;
|
|
7
|
+
export declare function randomPorts(num: number, protocol?: SocketType, interfaceAddresses?: InterfaceAddresses): Promise<number[]>;
|
|
8
|
+
export declare function findPort(min: number, max: number, protocol?: SocketType, interfaceAddresses?: InterfaceAddresses): Promise<number>;
|
|
9
|
+
export type Address = Readonly<[string, number]>;
|
|
10
|
+
export declare function normalizeFamilyNodeV18(family: string | number): 4 | 6;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function uint8Add(a: number, b: number): number;
|
|
2
|
+
export declare function uint16Add(a: number, b: number): number;
|
|
3
|
+
export declare function uint32Add(a: number, b: number): number;
|
|
4
|
+
export declare function uint24(v: number): number;
|
|
5
|
+
/**Return a > b */
|
|
6
|
+
export declare function uint16Gt(a: number, b: number): boolean;
|
|
7
|
+
/**Return a >= b */
|
|
8
|
+
export declare function uint16Gte(a: number, b: number): boolean;
|
|
9
|
+
/**Return a > b */
|
|
10
|
+
export declare function uint32Gt(a: number, b: number): boolean;
|
|
11
|
+
/**Return a >= b */
|
|
12
|
+
export declare function uint32Gte(a: number, b: number): boolean;
|
|
13
|
+
export declare const int: (n: number) => number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare class PromiseQueue {
|
|
2
|
+
queue: {
|
|
3
|
+
promise: () => Promise<unknown>;
|
|
4
|
+
done: (...args: any[]) => void;
|
|
5
|
+
failed: (...args: any[]) => void;
|
|
6
|
+
}[];
|
|
7
|
+
running: boolean;
|
|
8
|
+
push: <T>(promise: () => Promise<T>) => Promise<T>;
|
|
9
|
+
private run;
|
|
10
|
+
cancel(): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Runs a function that may return a promise without waiting for it: a failure, thrown or rejected, goes to onError.
|
|
14
|
+
* For the callbacks of the applications and the tasks started in the background, whose failures must not become
|
|
15
|
+
* unhandled rejections
|
|
16
|
+
*/
|
|
17
|
+
export declare function runDetached(fn: () => unknown, onError: (error: unknown) => void): void;
|
|
18
|
+
/**
|
|
19
|
+
* A function for an event or a timer: it runs fn without waiting for it, a failure going to onError
|
|
20
|
+
*/
|
|
21
|
+
export declare function detached<A extends unknown[]>(fn: (...args: A) => unknown, onError: (error: unknown) => void): (...args: A) => void;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type RemoteInfo, type Socket, type SocketType } from 'node:dgram';
|
|
2
|
+
import * as net from 'node:net';
|
|
3
|
+
import * as tls from 'node:tls';
|
|
4
|
+
import { type AddressInfo } from 'node:net';
|
|
5
|
+
import { type Address, type InterfaceAddresses } from './network.js';
|
|
6
|
+
export type TlsConnectionOptions = Omit<tls.ConnectionOptions, 'host' | 'port' | 'socket'>;
|
|
7
|
+
export interface StreamTransportOptions {
|
|
8
|
+
/** Maximum time to wait for TCP/TLS connection establishment, in milliseconds. */
|
|
9
|
+
connectTimeoutMs?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Grow the receive buffer of a bound UDP socket to 4 MiB, as far as the system allows (net.core.rmem_max on Linux); a
|
|
13
|
+
* buffer larger already is kept
|
|
14
|
+
* @param socket
|
|
15
|
+
*/
|
|
16
|
+
export declare function growReceiveBuffer(socket: Socket): void;
|
|
17
|
+
export declare class UdpTransport implements Transport {
|
|
18
|
+
private socketType;
|
|
19
|
+
private options;
|
|
20
|
+
readonly type = "udp";
|
|
21
|
+
readonly socket: Socket;
|
|
22
|
+
rinfo?: Partial<Pick<RemoteInfo, 'address' | 'port'>>;
|
|
23
|
+
onData: (data: Buffer, addr: Address) => void;
|
|
24
|
+
closed: boolean;
|
|
25
|
+
private connected?;
|
|
26
|
+
private connectOnReceive?;
|
|
27
|
+
private connecting?;
|
|
28
|
+
private waiting?;
|
|
29
|
+
private constructor();
|
|
30
|
+
static init(type: SocketType, options?: {
|
|
31
|
+
portRange?: [number, number];
|
|
32
|
+
port?: number;
|
|
33
|
+
interfaceAddresses?: InterfaceAddresses;
|
|
34
|
+
}): Promise<UdpTransport>;
|
|
35
|
+
private init;
|
|
36
|
+
/**
|
|
37
|
+
* Send only to an address from now on (the other side of the pair ICE selected), once application data comes from
|
|
38
|
+
* it: the other side sends its data on the pair then (a reply to a check does not tell it). Connected, the socket
|
|
39
|
+
* sends without the lookup and the routing of the address of each packet, and drops what it is asked to send
|
|
40
|
+
* elsewhere; the system drops the packets of the other addresses
|
|
41
|
+
* @param addr An IP address
|
|
42
|
+
*/
|
|
43
|
+
connectTo(addr: Address): void;
|
|
44
|
+
/**
|
|
45
|
+
* Send to any address again
|
|
46
|
+
*/
|
|
47
|
+
disconnect(): void;
|
|
48
|
+
private connectNow;
|
|
49
|
+
send: (data: Buffer, addr?: Address) => Promise<void>;
|
|
50
|
+
get address(): net.AddressInfo;
|
|
51
|
+
/** IP family of the bound socket: 4 for udp4, 6 for udp6. */
|
|
52
|
+
get addressFamily(): IpAddressFamily;
|
|
53
|
+
get host(): string;
|
|
54
|
+
get port(): number;
|
|
55
|
+
close: () => Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
export declare class TcpTransport implements Transport {
|
|
58
|
+
readonly type: "tcp";
|
|
59
|
+
private readonly stream;
|
|
60
|
+
private constructor();
|
|
61
|
+
static init(addr: Address, options?: StreamTransportOptions): Promise<TcpTransport>;
|
|
62
|
+
private init;
|
|
63
|
+
get address(): net.AddressInfo;
|
|
64
|
+
get remoteAddress(): readonly [string, number] | undefined;
|
|
65
|
+
get closed(): boolean;
|
|
66
|
+
get onData(): (data: Buffer, addr: Address) => void;
|
|
67
|
+
set onData(handler: (data: Buffer, addr: Address) => void);
|
|
68
|
+
send: (data: Buffer, addr?: Address) => Promise<void>;
|
|
69
|
+
close: () => Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
export declare class TlsTransport implements Transport {
|
|
72
|
+
readonly type: "tls";
|
|
73
|
+
private readonly stream;
|
|
74
|
+
private constructor();
|
|
75
|
+
static init(addr: Address, options?: TlsConnectionOptions, streamOptions?: StreamTransportOptions): Promise<TlsTransport>;
|
|
76
|
+
private init;
|
|
77
|
+
get address(): net.AddressInfo;
|
|
78
|
+
get remoteAddress(): readonly [string, number] | undefined;
|
|
79
|
+
get closed(): boolean;
|
|
80
|
+
get onData(): (data: Buffer, addr: Address) => void;
|
|
81
|
+
set onData(handler: (data: Buffer, addr: Address) => void);
|
|
82
|
+
send: (data: Buffer, addr?: Address) => Promise<void>;
|
|
83
|
+
close: () => Promise<void>;
|
|
84
|
+
}
|
|
85
|
+
export type IpAddressFamily = 4 | 6;
|
|
86
|
+
export interface Transport {
|
|
87
|
+
type: string;
|
|
88
|
+
address: AddressInfo;
|
|
89
|
+
closed: boolean;
|
|
90
|
+
onData: (data: Buffer, addr: Address) => void;
|
|
91
|
+
send: (data: Buffer, addr?: Address) => Promise<void>;
|
|
92
|
+
close: () => Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* IP family of a datagram socket. A datagram transport can only reach
|
|
95
|
+
* addresses of this family. Built-in UDP transports always set it; a custom
|
|
96
|
+
* transport that leaves it unset gets no family preference.
|
|
97
|
+
*/
|
|
98
|
+
addressFamily?: IpAddressFamily;
|
|
99
|
+
/**
|
|
100
|
+
* The peer a connected (stream) transport is talking to. Responses arrive
|
|
101
|
+
* from this address. Built-in TCP/TLS transports set it once connected.
|
|
102
|
+
*/
|
|
103
|
+
remoteAddress?: Address;
|
|
104
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const SignatureAlgorithm: {
|
|
2
|
+
readonly rsa_1: 1;
|
|
3
|
+
readonly ecdsa_3: 3;
|
|
4
|
+
};
|
|
5
|
+
export type SignatureAlgorithms = (typeof SignatureAlgorithm)[keyof typeof SignatureAlgorithm];
|
|
6
|
+
export declare const HashAlgorithm: {
|
|
7
|
+
readonly sha256_4: 4;
|
|
8
|
+
};
|
|
9
|
+
export type HashAlgorithms = (typeof HashAlgorithm)[keyof typeof HashAlgorithm];
|
|
10
|
+
export type SignatureHash = {
|
|
11
|
+
hash: HashAlgorithms;
|
|
12
|
+
signature: SignatureAlgorithms;
|
|
13
|
+
};
|
|
14
|
+
export declare const CipherSuite: {
|
|
15
|
+
readonly TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256_49195: 49195;
|
|
16
|
+
readonly TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256_49199: 49199;
|
|
17
|
+
};
|
|
18
|
+
export type CipherSuites = (typeof CipherSuite)[keyof typeof CipherSuite];
|
|
19
|
+
export declare const CipherSuiteList: CipherSuites[];
|
|
20
|
+
export declare const NamedCurveAlgorithm: {
|
|
21
|
+
readonly x25519_29: 29;
|
|
22
|
+
readonly secp256r1_23: 23;
|
|
23
|
+
};
|
|
24
|
+
export type NamedCurveAlgorithms = (typeof NamedCurveAlgorithm)[keyof typeof NamedCurveAlgorithm];
|
|
25
|
+
export declare const NamedCurveAlgorithmList: NamedCurveAlgorithms[];
|
|
26
|
+
export declare const CurveType: {
|
|
27
|
+
readonly named_curve_3: 3;
|
|
28
|
+
};
|
|
29
|
+
export type CurveTypes = (typeof CurveType)[keyof typeof CurveType];
|
|
30
|
+
export declare const SignatureScheme: {
|
|
31
|
+
readonly rsa_pkcs1_sha256: 1025;
|
|
32
|
+
readonly ecdsa_secp256r1_sha256: 1027;
|
|
33
|
+
};
|
|
34
|
+
export type SignatureSchemes = (typeof SignatureScheme)[keyof typeof SignatureScheme];
|
|
35
|
+
export declare const certificateTypes: number[];
|
|
36
|
+
export declare const signatures: ({
|
|
37
|
+
hash: 4;
|
|
38
|
+
signature: 1;
|
|
39
|
+
} | {
|
|
40
|
+
hash: 4;
|
|
41
|
+
signature: 3;
|
|
42
|
+
})[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CipherGCMTypes } from 'node:crypto';
|
|
2
|
+
import { type KeyExchange } from './key-exchange.js';
|
|
3
|
+
import AEADCipher from './suites/aead.js';
|
|
4
|
+
/**
|
|
5
|
+
* Convert cipher value to cipher instance.
|
|
6
|
+
* @param {number} cipher
|
|
7
|
+
*/
|
|
8
|
+
export declare function createCipher(cipher: number): AEADCipher;
|
|
9
|
+
/**
|
|
10
|
+
* @param {number} id An internal id of cipher suite.
|
|
11
|
+
* @param {string} name A valid cipher suite name.
|
|
12
|
+
* @param {string} block A valid nodejs cipher name.
|
|
13
|
+
* @param {KeyExchange} kx Key exchange type.
|
|
14
|
+
* @param {Object} constants Cipher specific constants.
|
|
15
|
+
* @param {string} hash
|
|
16
|
+
* @returns {AEADCipher}
|
|
17
|
+
*/
|
|
18
|
+
export declare function createAEADCipher(id: number, name: string, block: CipherGCMTypes, kx: KeyExchange, constants: {
|
|
19
|
+
K_LEN: number;
|
|
20
|
+
N_MAX: number;
|
|
21
|
+
}, hash?: string): AEADCipher;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A key pair of P-256 for ECDHE: the private scalar (32 bytes) and the uncompressed public point (65 bytes)
|
|
3
|
+
*/
|
|
4
|
+
export declare const p256Keypair: () => {
|
|
5
|
+
privateKey: Buffer;
|
|
6
|
+
publicKey: Buffer;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The premaster secret of ECDHE on P-256: the x coordinate of the shared point
|
|
10
|
+
*/
|
|
11
|
+
export declare const p256PreMasterSecret: ({ publicKey, privateKey }: {
|
|
12
|
+
publicKey: Buffer;
|
|
13
|
+
privateKey: Buffer;
|
|
14
|
+
}) => Buffer;
|
|
15
|
+
/**
|
|
16
|
+
* A key pair of X25519: both keys as their raw 32 bytes
|
|
17
|
+
*/
|
|
18
|
+
export declare const x25519Keypair: () => {
|
|
19
|
+
privateKey: Buffer;
|
|
20
|
+
publicKey: Buffer;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The premaster secret of X25519 from the raw keys
|
|
24
|
+
*/
|
|
25
|
+
export declare const x25519PreMasterSecret: ({ publicKey, privateKey }: {
|
|
26
|
+
publicKey: Buffer;
|
|
27
|
+
privateKey: Buffer;
|
|
28
|
+
}) => Buffer;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This class represent type of key exchange mechanism.
|
|
3
|
+
*/
|
|
4
|
+
export declare class KeyExchange {
|
|
5
|
+
id: number;
|
|
6
|
+
name?: string;
|
|
7
|
+
signType?: number;
|
|
8
|
+
keyType?: number;
|
|
9
|
+
/**
|
|
10
|
+
* @returns {string}
|
|
11
|
+
*/
|
|
12
|
+
toString(): string | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates `RSA` key exchange.
|
|
16
|
+
* @returns {KeyExchange}
|
|
17
|
+
*/
|
|
18
|
+
export declare function createRSAKeyExchange(): KeyExchange;
|
|
19
|
+
/**
|
|
20
|
+
* Creates `ECDHE_RSA` key exchange.
|
|
21
|
+
* @returns {KeyExchange}
|
|
22
|
+
*/
|
|
23
|
+
export declare function createECDHERSAKeyExchange(): KeyExchange;
|
|
24
|
+
/**
|
|
25
|
+
* Creates `ECDHE_ECDSA` key exchange.
|
|
26
|
+
* @returns {KeyExchange}
|
|
27
|
+
*/
|
|
28
|
+
export declare function createECDHEECDSAKeyExchange(): KeyExchange;
|
|
29
|
+
/**
|
|
30
|
+
* Creates `NULL` key exchange.
|
|
31
|
+
* @returns {KeyExchange}
|
|
32
|
+
*/
|
|
33
|
+
export declare function createNULLKeyExchange(): KeyExchange;
|
|
34
|
+
/**
|
|
35
|
+
* Creates `PSK` key exchange.
|
|
36
|
+
* @returns {KeyExchange}
|
|
37
|
+
*/
|
|
38
|
+
export declare function createPSKKeyExchange(): KeyExchange;
|
|
39
|
+
/**
|
|
40
|
+
* Creates `ECDHE_PSK` key exchange.
|
|
41
|
+
* @returns {KeyExchange}
|
|
42
|
+
*/
|
|
43
|
+
export declare function createECDHEPSKKeyExchange(): KeyExchange;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type NamedCurveAlgorithms } from './const.js';
|
|
2
|
+
export interface NamedCurveKeyPair {
|
|
3
|
+
curve: NamedCurveAlgorithms;
|
|
4
|
+
publicKey: Buffer;
|
|
5
|
+
privateKey: Buffer;
|
|
6
|
+
}
|
|
7
|
+
export declare function generateKeyPair(namedCurve: NamedCurveAlgorithms): NamedCurveKeyPair;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type NamedCurveAlgorithms } from './const.js';
|
|
2
|
+
export declare function prfPreMasterSecret(publicKey: Buffer, privateKey: Buffer, curve: NamedCurveAlgorithms): Buffer<ArrayBufferLike>;
|
|
3
|
+
export declare function hmac(algorithm: string, secret: Buffer, data: Buffer): NonSharedBuffer;
|
|
4
|
+
export declare function prfPHash(secret: Buffer, seed: Buffer, requestedLegth: number, algorithm?: string): Buffer<ArrayBuffer>;
|
|
5
|
+
export declare function prfMasterSecret(preMasterSecret: Buffer, clientRandom: Buffer, serverRandom: Buffer): Buffer<ArrayBuffer>;
|
|
6
|
+
export declare function prfExtendedMasterSecret(preMasterSecret: Buffer, handshakes: Buffer): Buffer<ArrayBuffer>;
|
|
7
|
+
export declare function exportKeyingMaterial(label: string, length: number, masterSecret: Buffer, localRandom: Buffer, remoteRandom: Buffer, isClient: boolean): Buffer<ArrayBuffer>;
|
|
8
|
+
export declare function hash(algorithm: string, data: Buffer): NonSharedBuffer;
|
|
9
|
+
export declare function prfVerifyData(masterSecret: Buffer, handshakes: Buffer, label: string, size?: number): Buffer<ArrayBuffer>;
|
|
10
|
+
export declare function prfVerifyDataClient(masterSecret: Buffer, handshakes: Buffer): Buffer<ArrayBuffer>;
|
|
11
|
+
export declare function prfVerifyDataServer(masterSecret: Buffer, handshakes: Buffer): Buffer<ArrayBuffer>;
|
|
12
|
+
export declare function prfEncryptionKeys(masterSecret: Buffer, clientRandom: Buffer, serverRandom: Buffer, prfKeyLen: number, prfIvLen: number, prfNonceLen: number, algorithm?: string): {
|
|
13
|
+
clientWriteKey: Buffer<ArrayBufferLike>;
|
|
14
|
+
serverWriteKey: Buffer<ArrayBufferLike>;
|
|
15
|
+
clientNonce: Buffer<ArrayBuffer>;
|
|
16
|
+
serverNonce: Buffer<ArrayBuffer>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { CipherGCMTypes } from 'node:crypto';
|
|
2
|
+
import type { KeyExchange } from '../key-exchange.js';
|
|
3
|
+
export type CipherHeader = {
|
|
4
|
+
type: number;
|
|
5
|
+
version: number;
|
|
6
|
+
epoch: number;
|
|
7
|
+
sequenceNumber: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const SessionType: {
|
|
10
|
+
readonly CLIENT: 1;
|
|
11
|
+
readonly SERVER: 2;
|
|
12
|
+
};
|
|
13
|
+
export type SessionTypes = (typeof SessionType)[keyof typeof SessionType];
|
|
14
|
+
export default abstract class AbstractCipher {
|
|
15
|
+
id: number;
|
|
16
|
+
name?: string;
|
|
17
|
+
hashAlgorithm?: string;
|
|
18
|
+
verifyDataLength: number;
|
|
19
|
+
blockAlgorithm?: CipherGCMTypes;
|
|
20
|
+
kx?: KeyExchange;
|
|
21
|
+
/**
|
|
22
|
+
* Init cipher.
|
|
23
|
+
* @abstract
|
|
24
|
+
*/
|
|
25
|
+
init(..._args: any): void;
|
|
26
|
+
/**
|
|
27
|
+
* Encrypts data.
|
|
28
|
+
* @abstract
|
|
29
|
+
*/
|
|
30
|
+
encrypt(..._args: any): Buffer;
|
|
31
|
+
/**
|
|
32
|
+
* Decrypts data.
|
|
33
|
+
* @abstract
|
|
34
|
+
*/
|
|
35
|
+
decrypt(..._args: any): Buffer;
|
|
36
|
+
/**
|
|
37
|
+
* @returns {string}
|
|
38
|
+
*/
|
|
39
|
+
toString(): string | undefined;
|
|
40
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Cipher, { type CipherHeader, type SessionTypes } from './abstract.js';
|
|
2
|
+
/**
|
|
3
|
+
* This class implements AEAD cipher family.
|
|
4
|
+
*/
|
|
5
|
+
export default class AEADCipher extends Cipher {
|
|
6
|
+
keyLength: number;
|
|
7
|
+
nonceLength: number;
|
|
8
|
+
ivLength: number;
|
|
9
|
+
authTagLength: number;
|
|
10
|
+
nonceImplicitLength: number;
|
|
11
|
+
nonceExplicitLength: number;
|
|
12
|
+
clientWriteKey?: Buffer;
|
|
13
|
+
serverWriteKey?: Buffer;
|
|
14
|
+
clientNonce?: Buffer;
|
|
15
|
+
serverNonce?: Buffer;
|
|
16
|
+
constructor();
|
|
17
|
+
get summary(): any;
|
|
18
|
+
init(masterSecret: Buffer, serverRandom: Buffer, clientRandom: Buffer): void;
|
|
19
|
+
/**
|
|
20
|
+
* Encrypt message.
|
|
21
|
+
*/
|
|
22
|
+
encrypt(type: SessionTypes, data: Buffer, header: CipherHeader): Buffer<ArrayBuffer>;
|
|
23
|
+
encodeAdditionalBuffer(header: CipherHeader, dataLength: number): Buffer<ArrayBuffer>;
|
|
24
|
+
/**
|
|
25
|
+
* Decrypt message.
|
|
26
|
+
*/
|
|
27
|
+
decrypt(type: SessionTypes, data: Buffer, header: CipherHeader): Buffer<ArrayBuffer>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Cipher from './abstract.js';
|
|
2
|
+
/**
|
|
3
|
+
* Default passthrough cipher.
|
|
4
|
+
*/
|
|
5
|
+
export default class NullCipher extends Cipher {
|
|
6
|
+
/**
|
|
7
|
+
* @class NullCipher
|
|
8
|
+
*/
|
|
9
|
+
constructor();
|
|
10
|
+
/**
|
|
11
|
+
* Encrypts data.
|
|
12
|
+
* @param {AbstractSession} session
|
|
13
|
+
* @param {Buffer} data Content to encryption.
|
|
14
|
+
* @returns {Buffer}
|
|
15
|
+
*/
|
|
16
|
+
encrypt(session: any, data: Buffer): Buffer<ArrayBufferLike>;
|
|
17
|
+
/**
|
|
18
|
+
* Decrypts data.
|
|
19
|
+
* @param {AbstractSession} session
|
|
20
|
+
* @param {Buffer} data Content to encryption.
|
|
21
|
+
* @returns {Buffer}
|
|
22
|
+
*/
|
|
23
|
+
decrypt(session: any, data: Buffer): Buffer<ArrayBufferLike>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Culculates HMAC using provided hash.
|
|
3
|
+
* @param {string} algorithm - Hash algorithm.
|
|
4
|
+
* @param {Buffer} secret - Hmac seed.
|
|
5
|
+
* @param {Buffer} data - Input data.
|
|
6
|
+
* @returns {Buffer}
|
|
7
|
+
*/
|
|
8
|
+
declare function hmac(algorithm: string, secret: Buffer, data: Buffer): NonSharedBuffer;
|
|
9
|
+
/**
|
|
10
|
+
* A data expansion function for PRF.
|
|
11
|
+
* @param {number} bytes - The number of bytes required by PRF.
|
|
12
|
+
* @param {string} algorithm - Hmac hash algorithm.
|
|
13
|
+
* @param {Buffer} secret - Hmac secret.
|
|
14
|
+
* @param {Buffer} seed - Input data.
|
|
15
|
+
* @returns {Buffer}
|
|
16
|
+
*/
|
|
17
|
+
declare function pHash(bytes: number, algorithm: string, secret: Buffer, seed: Buffer): Buffer<ArrayBuffer>;
|
|
18
|
+
export { hmac, pHash };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type KeyObject } from 'node:crypto';
|
|
2
|
+
/**
|
|
3
|
+
* The algorithm of the key of a self-signed certificate: ECDSA on P-256, or RSA (2048 bits)
|
|
4
|
+
*/
|
|
5
|
+
export type CertificateKeyType = 'ecdsa' | 'rsa';
|
|
6
|
+
/**
|
|
7
|
+
* A certificate and its private key, both in PEM
|
|
8
|
+
*/
|
|
9
|
+
export interface CertificatePem {
|
|
10
|
+
certPem: string;
|
|
11
|
+
keyPem: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates a self-signed X.509 certificate for DTLS: the peers of WebRTC check it against the fingerprint in the SDP,
|
|
15
|
+
* not against a certificate authority, so it only has to be well formed
|
|
16
|
+
* @param keyType The algorithm of the key; ECDSA on P-256 by default, as the browsers use
|
|
17
|
+
* @param name The common name of the subject and the issuer
|
|
18
|
+
* @param days How long the certificate is valid, from a day before now
|
|
19
|
+
* @returns The certificate and its private key (PKCS #8), in PEM
|
|
20
|
+
*/
|
|
21
|
+
export declare function createDtlsCertificate(keyType?: CertificateKeyType, name?: string, days?: number): CertificatePem;
|
|
22
|
+
/**
|
|
23
|
+
* Wraps DER in PEM, 64 characters of base64 per line
|
|
24
|
+
*/
|
|
25
|
+
export declare function toPem(derBytes: Buffer, label: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* The DER of the first certificate of a PEM text
|
|
28
|
+
*/
|
|
29
|
+
export declare function certificateDer(pem: string): Buffer;
|
|
30
|
+
/**
|
|
31
|
+
* The private key of a PEM text (PKCS #8, PKCS #1 or SEC 1)
|
|
32
|
+
*/
|
|
33
|
+
export declare function privateKeyFromPem(pem: string): KeyObject;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type KeyObject } from 'node:crypto';
|
|
2
|
+
import { type CipherSuites, type NamedCurveAlgorithms, type SignatureHash } from '../cipher/const.js';
|
|
3
|
+
import type { NamedCurveKeyPair } from '../cipher/namedCurve.js';
|
|
4
|
+
import { type SessionTypes } from '../cipher/suites/abstract.js';
|
|
5
|
+
import type AEADCipher from '../cipher/suites/aead.js';
|
|
6
|
+
import type { DtlsRandom } from '../handshake/random.js';
|
|
7
|
+
import type { DtlsPlaintext } from '../record/message/plaintext.js';
|
|
8
|
+
export declare class CipherContext {
|
|
9
|
+
sessionType: SessionTypes;
|
|
10
|
+
certPem?: string | undefined;
|
|
11
|
+
keyPem?: string | undefined;
|
|
12
|
+
localRandom: DtlsRandom;
|
|
13
|
+
remoteRandom: DtlsRandom;
|
|
14
|
+
cipherSuite: CipherSuites;
|
|
15
|
+
remoteCertificate?: Buffer;
|
|
16
|
+
remoteKeyPair: Partial<NamedCurveKeyPair>;
|
|
17
|
+
localKeyPair: NamedCurveKeyPair;
|
|
18
|
+
masterSecret: Buffer;
|
|
19
|
+
cipher: AEADCipher;
|
|
20
|
+
namedCurve: NamedCurveAlgorithms;
|
|
21
|
+
signatureHashAlgorithm?: SignatureHash;
|
|
22
|
+
localCert: Buffer;
|
|
23
|
+
localPrivateKey: KeyObject;
|
|
24
|
+
constructor(sessionType: SessionTypes, certPem?: string | undefined, keyPem?: string | undefined, signatureHashAlgorithm?: SignatureHash);
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param signatureHash
|
|
28
|
+
* @param namedCurveAlgorithm necessary when use ecdsa
|
|
29
|
+
*/
|
|
30
|
+
static createSelfSignedCertificateWithKey: (signatureHash: SignatureHash, _namedCurveAlgorithm?: NamedCurveAlgorithms) => Promise<{
|
|
31
|
+
certPem: string;
|
|
32
|
+
keyPem: string;
|
|
33
|
+
signatureHash: SignatureHash;
|
|
34
|
+
}>;
|
|
35
|
+
encryptPacket(pkt: DtlsPlaintext): DtlsPlaintext;
|
|
36
|
+
decryptPacket(pkt: DtlsPlaintext): Buffer<ArrayBuffer>;
|
|
37
|
+
verifyData(buf: Buffer): Buffer<ArrayBuffer>;
|
|
38
|
+
signatureData(data: Buffer, hash: string): NonSharedBuffer;
|
|
39
|
+
generateKeySignature(hashAlgorithm: string): NonSharedBuffer;
|
|
40
|
+
parseX509(certPem: string, keyPem: string, signatureHash: SignatureHash): void;
|
|
41
|
+
private valueKeySignature;
|
|
42
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { HashAlgorithms, SignatureAlgorithms } from '../cipher/const.js';
|
|
2
|
+
import type { SessionTypes } from '../cipher/suites/abstract.js';
|
|
3
|
+
import type { FragmentedHandshake } from '../record/message/fragment.js';
|
|
4
|
+
import type { Options } from '../socket.js';
|
|
5
|
+
import type { Handshake } from '../typings/domain.js';
|
|
6
|
+
export declare class DtlsContext {
|
|
7
|
+
options: Options;
|
|
8
|
+
sessionType: SessionTypes;
|
|
9
|
+
version: {
|
|
10
|
+
major: number;
|
|
11
|
+
minor: number;
|
|
12
|
+
};
|
|
13
|
+
lastFlight: Handshake[];
|
|
14
|
+
lastMessage: Buffer[];
|
|
15
|
+
recordSequenceNumber: number;
|
|
16
|
+
sequenceNumber: number;
|
|
17
|
+
epoch: number;
|
|
18
|
+
flight: number;
|
|
19
|
+
handshakeCache: {
|
|
20
|
+
[flight: number]: {
|
|
21
|
+
isLocal: boolean;
|
|
22
|
+
data: FragmentedHandshake[];
|
|
23
|
+
flight: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
cookie?: Buffer;
|
|
27
|
+
requestedCertificateTypes: number[];
|
|
28
|
+
requestedSignatureAlgorithms: {
|
|
29
|
+
hash: HashAlgorithms;
|
|
30
|
+
signature: SignatureAlgorithms;
|
|
31
|
+
}[];
|
|
32
|
+
remoteExtendedMasterSecret: boolean;
|
|
33
|
+
constructor(options: Options, sessionType: SessionTypes);
|
|
34
|
+
get sessionId(): string;
|
|
35
|
+
get sortedHandshakeCache(): FragmentedHandshake[];
|
|
36
|
+
checkHandshakesExist: (handshakes: number[]) => boolean;
|
|
37
|
+
bufferHandshakeCache(handshakes: FragmentedHandshake[], isLocal: boolean, flight: number): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Address, Transport } from '../imports/common.js';
|
|
2
|
+
export declare class TransportContext {
|
|
3
|
+
socket: Transport;
|
|
4
|
+
readonly closing: AbortController;
|
|
5
|
+
constructor(socket: Transport);
|
|
6
|
+
readonly send: (buf: Buffer, addr?: Address) => Promise<void>;
|
|
7
|
+
close(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CipherContext } from '../../context/cipher.js';
|
|
2
|
+
import type { DtlsContext } from '../../context/dtls.js';
|
|
3
|
+
import type { TransportContext } from '../../context/transport.js';
|
|
4
|
+
import type { Extension } from '../../typings/domain.js';
|
|
5
|
+
import { Flight } from '../flight.js';
|
|
6
|
+
export declare class Flight1 extends Flight {
|
|
7
|
+
private cipher;
|
|
8
|
+
constructor(udp: TransportContext, dtls: DtlsContext, cipher: CipherContext);
|
|
9
|
+
exec(extensions: Extension[]): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DtlsContext } from '../../context/dtls.js';
|
|
2
|
+
import type { TransportContext } from '../../context/transport.js';
|
|
3
|
+
import type { ServerHelloVerifyRequest } from '../../handshake/message/server/helloVerifyRequest.js';
|
|
4
|
+
import { Flight } from '../flight.js';
|
|
5
|
+
export declare class Flight3 extends Flight {
|
|
6
|
+
constructor(udp: TransportContext, dtls: DtlsContext);
|
|
7
|
+
exec(verifyReq: ServerHelloVerifyRequest): Promise<void>;
|
|
8
|
+
}
|