werift 0.27.0 → 0.29.0
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/README.md +299 -8
- package/lib/common/src/event.d.ts +26 -0
- package/lib/common/src/event.js +87 -2
- package/lib/common/src/event.js.map +1 -1
- package/lib/common/src/network.d.ts +6 -1
- package/lib/common/src/network.js +8 -2
- package/lib/common/src/network.js.map +1 -1
- package/lib/common/src/transport.d.ts +51 -10
- package/lib/common/src/transport.js +35 -9
- package/lib/common/src/transport.js.map +1 -1
- package/lib/dtls/src/alert.d.ts +49 -0
- package/lib/dtls/src/alert.js +103 -0
- package/lib/dtls/src/alert.js.map +1 -0
- package/lib/dtls/src/carrier/direct.d.ts +67 -0
- package/lib/dtls/src/carrier/direct.js +226 -0
- package/lib/dtls/src/carrier/direct.js.map +1 -0
- package/lib/dtls/src/carrier/types.d.ts +81 -0
- package/lib/dtls/src/carrier/types.js +7 -0
- package/lib/dtls/src/carrier/types.js.map +1 -0
- package/lib/dtls/src/cipher/const.d.ts +6 -0
- package/lib/dtls/src/cipher/const.js +13 -2
- package/lib/dtls/src/cipher/const.js.map +1 -1
- package/lib/dtls/src/cipher/prf.js +11 -2
- package/lib/dtls/src/cipher/prf.js.map +1 -1
- package/lib/dtls/src/cipher/tls13/aead.d.ts +41 -0
- package/lib/dtls/src/cipher/tls13/aead.js +128 -0
- package/lib/dtls/src/cipher/tls13/aead.js.map +1 -0
- package/lib/dtls/src/cipher/tls13/hkdf.d.ts +30 -0
- package/lib/dtls/src/cipher/tls13/hkdf.js +76 -0
- package/lib/dtls/src/cipher/tls13/hkdf.js.map +1 -0
- package/lib/dtls/src/cipher/tls13/keySchedule.d.ts +70 -0
- package/lib/dtls/src/cipher/tls13/keySchedule.js +114 -0
- package/lib/dtls/src/cipher/tls13/keySchedule.js.map +1 -0
- package/lib/dtls/src/cipher/tls13/signature.d.ts +30 -0
- package/lib/dtls/src/cipher/tls13/signature.js +149 -0
- package/lib/dtls/src/cipher/tls13/signature.js.map +1 -0
- package/lib/dtls/src/client.d.ts +253 -0
- package/lib/dtls/src/client.js +1269 -14
- package/lib/dtls/src/client.js.map +1 -1
- package/lib/dtls/src/context/dtls.d.ts +47 -0
- package/lib/dtls/src/context/dtls.js +121 -0
- package/lib/dtls/src/context/dtls.js.map +1 -1
- package/lib/dtls/src/context/transport.d.ts +30 -1
- package/lib/dtls/src/context/transport.js +67 -3
- package/lib/dtls/src/context/transport.js.map +1 -1
- package/lib/dtls/src/engine/v1_3/connection-base.d.ts +520 -0
- package/lib/dtls/src/engine/v1_3/connection-base.js +1644 -0
- package/lib/dtls/src/engine/v1_3/connection-base.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/connection.d.ts +181 -0
- package/lib/dtls/src/engine/v1_3/connection.js +680 -0
- package/lib/dtls/src/engine/v1_3/connection.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/early-data-buffer.d.ts +38 -0
- package/lib/dtls/src/engine/v1_3/early-data-buffer.js +166 -0
- package/lib/dtls/src/engine/v1_3/early-data-buffer.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight/certificate.d.ts +4 -0
- package/lib/dtls/src/engine/v1_3/flight/certificate.js +62 -0
- package/lib/dtls/src/engine/v1_3/flight/certificate.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight/client/flight1.d.ts +8 -0
- package/lib/dtls/src/engine/v1_3/flight/client/flight1.js +119 -0
- package/lib/dtls/src/engine/v1_3/flight/client/flight1.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight/client/flight4.d.ts +8 -0
- package/lib/dtls/src/engine/v1_3/flight/client/flight4.js +251 -0
- package/lib/dtls/src/engine/v1_3/flight/client/flight4.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight/client/flight5.d.ts +5 -0
- package/lib/dtls/src/engine/v1_3/flight/client/flight5.js +99 -0
- package/lib/dtls/src/engine/v1_3/flight/client/flight5.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight/dispatch.d.ts +12 -0
- package/lib/dtls/src/engine/v1_3/flight/dispatch.js +138 -0
- package/lib/dtls/src/engine/v1_3/flight/dispatch.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight/extensions.d.ts +13 -0
- package/lib/dtls/src/engine/v1_3/flight/extensions.js +46 -0
- package/lib/dtls/src/engine/v1_3/flight/extensions.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight/finished.d.ts +6 -0
- package/lib/dtls/src/engine/v1_3/flight/finished.js +16 -0
- package/lib/dtls/src/engine/v1_3/flight/finished.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight/post-hs.d.ts +12 -0
- package/lib/dtls/src/engine/v1_3/flight/post-hs.js +94 -0
- package/lib/dtls/src/engine/v1_3/flight/post-hs.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight/server/flight2.d.ts +21 -0
- package/lib/dtls/src/engine/v1_3/flight/server/flight2.js +227 -0
- package/lib/dtls/src/engine/v1_3/flight/server/flight2.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight/server/flight4.d.ts +6 -0
- package/lib/dtls/src/engine/v1_3/flight/server/flight4.js +455 -0
- package/lib/dtls/src/engine/v1_3/flight/server/flight4.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight/server/flight5.d.ts +5 -0
- package/lib/dtls/src/engine/v1_3/flight/server/flight5.js +48 -0
- package/lib/dtls/src/engine/v1_3/flight/server/flight5.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/flight-tx.d.ts +119 -0
- package/lib/dtls/src/engine/v1_3/flight-tx.js +782 -0
- package/lib/dtls/src/engine/v1_3/flight-tx.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/host.d.ts +86 -0
- package/lib/dtls/src/engine/v1_3/host.js +11 -0
- package/lib/dtls/src/engine/v1_3/host.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/record-rx.d.ts +77 -0
- package/lib/dtls/src/engine/v1_3/record-rx.js +818 -0
- package/lib/dtls/src/engine/v1_3/record-rx.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/transcript.d.ts +22 -0
- package/lib/dtls/src/engine/v1_3/transcript.js +65 -0
- package/lib/dtls/src/engine/v1_3/transcript.js.map +1 -0
- package/lib/dtls/src/engine/v1_3/types.d.ts +169 -0
- package/lib/dtls/src/engine/v1_3/types.js +113 -0
- package/lib/dtls/src/engine/v1_3/types.js.map +1 -0
- package/lib/dtls/src/flight/client/flight1.d.ts +7 -1
- package/lib/dtls/src/flight/client/flight1.js +9 -3
- package/lib/dtls/src/flight/client/flight1.js.map +1 -1
- package/lib/dtls/src/flight/client/flight3.d.ts +8 -0
- package/lib/dtls/src/flight/client/flight3.js +24 -4
- package/lib/dtls/src/flight/client/flight3.js.map +1 -1
- package/lib/dtls/src/flight/client/flight5.js +17 -2
- package/lib/dtls/src/flight/client/flight5.js.map +1 -1
- package/lib/dtls/src/flight/flight.d.ts +21 -0
- package/lib/dtls/src/flight/flight.js +119 -9
- package/lib/dtls/src/flight/flight.js.map +1 -1
- package/lib/dtls/src/flight/server/commitClientHello.d.ts +35 -0
- package/lib/dtls/src/flight/server/commitClientHello.js +149 -0
- package/lib/dtls/src/flight/server/commitClientHello.js.map +1 -0
- package/lib/dtls/src/flight/server/flight2.d.ts +12 -3
- package/lib/dtls/src/flight/server/flight2.js +29 -105
- package/lib/dtls/src/flight/server/flight2.js.map +1 -1
- package/lib/dtls/src/flight/server/flight4.js +14 -2
- package/lib/dtls/src/flight/server/flight4.js.map +1 -1
- package/lib/dtls/src/flight/server/flight6.js +12 -1
- package/lib/dtls/src/flight/server/flight6.js.map +1 -1
- package/lib/dtls/src/handshake/const.d.ts +10 -0
- package/lib/dtls/src/handshake/const.js +10 -0
- package/lib/dtls/src/handshake/const.js.map +1 -1
- package/lib/dtls/src/handshake/extensions/cookie.d.ts +113 -0
- package/lib/dtls/src/handshake/extensions/cookie.js +326 -0
- package/lib/dtls/src/handshake/extensions/cookie.js.map +1 -0
- package/lib/dtls/src/handshake/extensions/ids.d.ts +7 -0
- package/lib/dtls/src/handshake/extensions/ids.js +11 -0
- package/lib/dtls/src/handshake/extensions/ids.js.map +1 -0
- package/lib/dtls/src/handshake/extensions/keyShare.d.ts +28 -0
- package/lib/dtls/src/handshake/extensions/keyShare.js +156 -0
- package/lib/dtls/src/handshake/extensions/keyShare.js.map +1 -0
- package/lib/dtls/src/handshake/extensions/signatureAlgorithms.d.ts +27 -0
- package/lib/dtls/src/handshake/extensions/signatureAlgorithms.js +67 -0
- package/lib/dtls/src/handshake/extensions/signatureAlgorithms.js.map +1 -0
- package/lib/dtls/src/handshake/extensions/supportedVersions.d.ts +20 -0
- package/lib/dtls/src/handshake/extensions/supportedVersions.js +90 -0
- package/lib/dtls/src/handshake/extensions/supportedVersions.js.map +1 -0
- package/lib/dtls/src/handshake/extensions/unique.d.ts +7 -0
- package/lib/dtls/src/handshake/extensions/unique.js +19 -0
- package/lib/dtls/src/handshake/extensions/unique.js.map +1 -0
- package/lib/dtls/src/handshake/extensions/useSrtp.d.ts +26 -3
- package/lib/dtls/src/handshake/extensions/useSrtp.js +68 -12
- package/lib/dtls/src/handshake/extensions/useSrtp.js.map +1 -1
- package/lib/dtls/src/handshake/message/tls13/ack.d.ts +50 -0
- package/lib/dtls/src/handshake/message/tls13/ack.js +107 -0
- package/lib/dtls/src/handshake/message/tls13/ack.js.map +1 -0
- package/lib/dtls/src/handshake/message/tls13/certificate.d.ts +17 -0
- package/lib/dtls/src/handshake/message/tls13/certificate.js +112 -0
- package/lib/dtls/src/handshake/message/tls13/certificate.js.map +1 -0
- package/lib/dtls/src/handshake/message/tls13/certificateRequest.d.ts +17 -0
- package/lib/dtls/src/handshake/message/tls13/certificateRequest.js +99 -0
- package/lib/dtls/src/handshake/message/tls13/certificateRequest.js.map +1 -0
- package/lib/dtls/src/handshake/message/tls13/certificateVerify.d.ts +21 -0
- package/lib/dtls/src/handshake/message/tls13/certificateVerify.js +77 -0
- package/lib/dtls/src/handshake/message/tls13/certificateVerify.js.map +1 -0
- package/lib/dtls/src/handshake/message/tls13/encryptedExtensions.d.ts +19 -0
- package/lib/dtls/src/handshake/message/tls13/encryptedExtensions.js +56 -0
- package/lib/dtls/src/handshake/message/tls13/encryptedExtensions.js.map +1 -0
- package/lib/dtls/src/handshake/message/tls13/keyUpdate.d.ts +13 -0
- package/lib/dtls/src/handshake/message/tls13/keyUpdate.js +54 -0
- package/lib/dtls/src/handshake/message/tls13/keyUpdate.js.map +1 -0
- package/lib/dtls/src/handshake/message/tls13/newSessionTicket.d.ts +33 -0
- package/lib/dtls/src/handshake/message/tls13/newSessionTicket.js +158 -0
- package/lib/dtls/src/handshake/message/tls13/newSessionTicket.js.map +1 -0
- package/lib/dtls/src/handshake/random.d.ts +14 -0
- package/lib/dtls/src/handshake/random.js +24 -0
- package/lib/dtls/src/handshake/random.js.map +1 -1
- package/lib/dtls/src/handshake/validation.d.ts +26 -0
- package/lib/dtls/src/handshake/validation.js +32 -0
- package/lib/dtls/src/handshake/validation.js.map +1 -0
- package/lib/dtls/src/index.d.ts +8 -1
- package/lib/dtls/src/index.js +125 -44
- package/lib/dtls/src/index.js.map +1 -1
- package/lib/dtls/src/internal.d.ts +7 -0
- package/lib/dtls/src/internal.js +57 -0
- package/lib/dtls/src/internal.js.map +1 -0
- package/lib/dtls/src/peer.d.ts +49 -0
- package/lib/dtls/src/peer.js +54 -0
- package/lib/dtls/src/peer.js.map +1 -0
- package/lib/dtls/src/record/antiReplayWindow.d.ts +33 -0
- package/lib/dtls/src/record/antiReplayWindow.js +119 -0
- package/lib/dtls/src/record/antiReplayWindow.js.map +1 -0
- package/lib/dtls/src/record/const.d.ts +15 -0
- package/lib/dtls/src/record/const.js +15 -1
- package/lib/dtls/src/record/const.js.map +1 -1
- package/lib/dtls/src/record/message/fragment.d.ts +0 -2
- package/lib/dtls/src/record/message/fragment.js +36 -17
- package/lib/dtls/src/record/message/fragment.js.map +1 -1
- package/lib/dtls/src/record/message/reassembler.d.ts +62 -0
- package/lib/dtls/src/record/message/reassembler.js +249 -0
- package/lib/dtls/src/record/message/reassembler.js.map +1 -0
- package/lib/dtls/src/record/receive.d.ts +6 -0
- package/lib/dtls/src/record/receive.js +58 -19
- package/lib/dtls/src/record/receive.js.map +1 -1
- package/lib/dtls/src/record/v1_3/header.d.ts +34 -0
- package/lib/dtls/src/record/v1_3/header.js +95 -0
- package/lib/dtls/src/record/v1_3/header.js.map +1 -0
- package/lib/dtls/src/record/v1_3/record.d.ts +133 -0
- package/lib/dtls/src/record/v1_3/record.js +370 -0
- package/lib/dtls/src/record/v1_3/record.js.map +1 -0
- package/lib/dtls/src/retransmission.d.ts +26 -0
- package/lib/dtls/src/retransmission.js +39 -0
- package/lib/dtls/src/retransmission.js.map +1 -0
- package/lib/dtls/src/server.d.ts +38 -0
- package/lib/dtls/src/server.js +382 -17
- package/lib/dtls/src/server.js.map +1 -1
- package/lib/dtls/src/socket.d.ts +487 -11
- package/lib/dtls/src/socket.js +1359 -70
- package/lib/dtls/src/socket.js.map +1 -1
- package/lib/dtls/src/version.d.ts +89 -0
- package/lib/dtls/src/version.js +204 -0
- package/lib/dtls/src/version.js.map +1 -0
- package/lib/ice/src/candidateError.d.ts +155 -0
- package/lib/ice/src/candidateError.js +246 -0
- package/lib/ice/src/candidateError.js.map +1 -0
- package/lib/ice/src/candidateGatherer.d.ts +127 -0
- package/lib/ice/src/candidateGatherer.js +745 -0
- package/lib/ice/src/candidateGatherer.js.map +1 -0
- package/lib/ice/src/consent.d.ts +126 -0
- package/lib/ice/src/consent.js +470 -0
- package/lib/ice/src/consent.js.map +1 -0
- package/lib/ice/src/dns/lookup.d.ts +10 -0
- package/lib/ice/src/dns/lookup.js +130 -3
- package/lib/ice/src/dns/lookup.js.map +1 -1
- package/lib/ice/src/exceptions.d.ts +9 -0
- package/lib/ice/src/exceptions.js +14 -1
- package/lib/ice/src/exceptions.js.map +1 -1
- package/lib/ice/src/failover.d.ts +270 -0
- package/lib/ice/src/failover.js +674 -0
- package/lib/ice/src/failover.js.map +1 -0
- package/lib/ice/src/gatheringError.d.ts +28 -0
- package/lib/ice/src/gatheringError.js +17 -0
- package/lib/ice/src/gatheringError.js.map +1 -0
- package/lib/ice/src/ice.d.ts +486 -78
- package/lib/ice/src/ice.js +2415 -1129
- package/lib/ice/src/ice.js.map +1 -1
- package/lib/ice/src/iceBase.d.ts +404 -14
- package/lib/ice/src/iceBase.js +251 -38
- package/lib/ice/src/iceBase.js.map +1 -1
- package/lib/ice/src/index.d.ts +3 -0
- package/lib/ice/src/index.js +5 -1
- package/lib/ice/src/index.js.map +1 -1
- package/lib/ice/src/internal/checkMessages.d.ts +41 -0
- package/lib/ice/src/internal/checkMessages.js +63 -0
- package/lib/ice/src/internal/checkMessages.js.map +1 -0
- package/lib/ice/src/internal/datagram.d.ts +37 -0
- package/lib/ice/src/internal/datagram.js +45 -0
- package/lib/ice/src/internal/datagram.js.map +1 -0
- package/lib/ice/src/internal/defaultRoute.d.ts +20 -0
- package/lib/ice/src/internal/defaultRoute.js +134 -0
- package/lib/ice/src/internal/defaultRoute.js.map +1 -0
- package/lib/ice/src/internal/hostInterfaces.d.ts +28 -0
- package/lib/ice/src/internal/hostInterfaces.js +89 -0
- package/lib/ice/src/internal/hostInterfaces.js.map +1 -0
- package/lib/ice/src/internal/hostPreference.d.ts +24 -0
- package/lib/ice/src/internal/hostPreference.js +38 -0
- package/lib/ice/src/internal/hostPreference.js.map +1 -0
- package/lib/ice/src/internal/resolveHostAddresses.d.ts +56 -8
- package/lib/ice/src/internal/resolveHostAddresses.js +127 -24
- package/lib/ice/src/internal/resolveHostAddresses.js.map +1 -1
- package/lib/ice/src/internal/selectAddresses.d.ts +27 -0
- package/lib/ice/src/internal/selectAddresses.js +37 -18
- package/lib/ice/src/internal/selectAddresses.js.map +1 -1
- package/lib/ice/src/internal/sped-bind.d.ts +44 -0
- package/lib/ice/src/internal/sped-bind.js +53 -0
- package/lib/ice/src/internal/sped-bind.js.map +1 -0
- package/lib/ice/src/internal/sped-binding-cache.d.ts +27 -0
- package/lib/ice/src/internal/sped-binding-cache.js +102 -0
- package/lib/ice/src/internal/sped-binding-cache.js.map +1 -0
- package/lib/ice/src/internal/sped.d.ts +15 -0
- package/lib/ice/src/internal/sped.js +62 -0
- package/lib/ice/src/internal/sped.js.map +1 -0
- package/lib/ice/src/nomination/regularNomination.d.ts +200 -0
- package/lib/ice/src/nomination/regularNomination.js +311 -0
- package/lib/ice/src/nomination/regularNomination.js.map +1 -0
- package/lib/ice/src/nomination/selectionController.d.ts +111 -0
- package/lib/ice/src/nomination/selectionController.js +172 -0
- package/lib/ice/src/nomination/selectionController.js.map +1 -0
- package/lib/ice/src/nomination/selectionReplacement.d.ts +178 -0
- package/lib/ice/src/nomination/selectionReplacement.js +429 -0
- package/lib/ice/src/nomination/selectionReplacement.js.map +1 -0
- package/lib/ice/src/provisional.d.ts +139 -0
- package/lib/ice/src/provisional.js +468 -0
- package/lib/ice/src/provisional.js.map +1 -0
- package/lib/ice/src/sped/draft00/codec.d.ts +20 -0
- package/lib/ice/src/sped/draft00/codec.js +59 -0
- package/lib/ice/src/sped/draft00/codec.js.map +1 -0
- package/lib/ice/src/sped/draft00/constants.d.ts +14 -0
- package/lib/ice/src/sped/draft00/constants.js +18 -0
- package/lib/ice/src/sped/draft00/constants.js.map +1 -0
- package/lib/ice/src/sped/draft00/index.d.ts +6 -0
- package/lib/ice/src/sped/draft00/index.js +26 -0
- package/lib/ice/src/sped/draft00/index.js.map +1 -0
- package/lib/ice/src/sped/draft00/mtu.d.ts +38 -0
- package/lib/ice/src/sped/draft00/mtu.js +96 -0
- package/lib/ice/src/sped/draft00/mtu.js.map +1 -0
- package/lib/ice/src/sped/draft00/session.d.ts +86 -0
- package/lib/ice/src/sped/draft00/session.js +353 -0
- package/lib/ice/src/sped/draft00/session.js.map +1 -0
- package/lib/ice/src/sped/draft00/types.d.ts +16 -0
- package/lib/ice/src/sped/draft00/types.js +3 -0
- package/lib/ice/src/sped/draft00/types.js.map +1 -0
- package/lib/ice/src/sped/runtime.d.ts +188 -0
- package/lib/ice/src/sped/runtime.js +643 -0
- package/lib/ice/src/sped/runtime.js.map +1 -0
- package/lib/ice/src/stun/protocol.d.ts +38 -2
- package/lib/ice/src/stun/protocol.js +107 -21
- package/lib/ice/src/stun/protocol.js.map +1 -1
- package/lib/ice/src/stun/rawAttributeValue.d.ts +1 -0
- package/lib/ice/src/stun/rawAttributeValue.js +6 -0
- package/lib/ice/src/stun/rawAttributeValue.js.map +1 -0
- package/lib/ice/src/stun/tcpProtocol.d.ts +2 -1
- package/lib/ice/src/stun/tcpProtocol.js +21 -9
- package/lib/ice/src/stun/tcpProtocol.js.map +1 -1
- package/lib/ice/src/stun/transaction.d.ts +4 -0
- package/lib/ice/src/stun/transaction.js +27 -2
- package/lib/ice/src/stun/transaction.js.map +1 -1
- package/lib/ice/src/turn/protocol.d.ts +23 -4
- package/lib/ice/src/turn/protocol.js +99 -11
- package/lib/ice/src/turn/protocol.js.map +1 -1
- package/lib/ice/src/types/model.d.ts +25 -5
- package/lib/ice/src/types/model.js.map +1 -1
- package/lib/ice/src/utils.d.ts +13 -0
- package/lib/ice/src/utils.js +13 -0
- package/lib/ice/src/utils.js.map +1 -1
- package/lib/ice-server/src/stun/attributes.js +4 -0
- package/lib/ice-server/src/stun/attributes.js.map +1 -1
- package/lib/ice-server/src/stun/const.d.ts +20 -1
- package/lib/ice-server/src/stun/const.js +9 -1
- package/lib/ice-server/src/stun/const.js.map +1 -1
- package/lib/ice-server/src/stun/message.d.ts +43 -3
- package/lib/ice-server/src/stun/message.js +258 -40
- package/lib/ice-server/src/stun/message.js.map +1 -1
- package/lib/ice-server/src/stun/rawAttributeValue.d.ts +6 -0
- package/lib/ice-server/src/stun/rawAttributeValue.js +12 -0
- package/lib/ice-server/src/stun/rawAttributeValue.js.map +1 -0
- package/lib/index.mjs +47427 -25303
- package/lib/nonstandard/index.mjs +3076 -1318
- package/lib/polyfill/dom.mjs +40430 -18730
- package/lib/polyfill/index.mjs +40333 -18639
- package/lib/rtp/src/extra/processor/fsRetry.d.ts +20 -0
- package/lib/rtp/src/extra/processor/fsRetry.js +73 -0
- package/lib/rtp/src/extra/processor/fsRetry.js.map +1 -0
- package/lib/rtp/src/extra/processor/webm.d.ts +6 -0
- package/lib/rtp/src/extra/processor/webm.js +6 -2
- package/lib/rtp/src/extra/processor/webm.js.map +1 -1
- package/lib/rtp/src/extra/processor/webmCallback.d.ts +11 -0
- package/lib/rtp/src/extra/processor/webmCallback.js +23 -31
- package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/webmFileWriter.d.ts +24 -0
- package/lib/rtp/src/extra/processor/webmFileWriter.js +94 -0
- package/lib/rtp/src/extra/processor/webmFileWriter.js.map +1 -0
- package/lib/rtp/src/index.d.ts +1 -0
- package/lib/rtp/src/index.js +1 -0
- package/lib/rtp/src/index.js.map +1 -1
- package/lib/rtp/src/rtp/continuity.d.ts +14 -1
- package/lib/rtp/src/rtp/continuity.js +24 -4
- package/lib/rtp/src/rtp/continuity.js.map +1 -1
- package/lib/rtp/src/rtp/timelineRewriter.d.ts +178 -0
- package/lib/rtp/src/rtp/timelineRewriter.js +417 -0
- package/lib/rtp/src/rtp/timelineRewriter.js.map +1 -0
- package/lib/sctp/src/chunk.d.ts +5 -0
- package/lib/sctp/src/chunk.js +10 -0
- package/lib/sctp/src/chunk.js.map +1 -1
- package/lib/sctp/src/index.d.ts +1 -1
- package/lib/sctp/src/index.js +4 -1
- package/lib/sctp/src/index.js.map +1 -1
- package/lib/sctp/src/sctp.d.ts +86 -5
- package/lib/sctp/src/sctp.js +354 -75
- package/lib/sctp/src/sctp.js.map +1 -1
- package/lib/webrtc/src/api/compatibilityOptions.d.ts +43 -0
- package/lib/webrtc/src/api/compatibilityOptions.js +43 -0
- package/lib/webrtc/src/api/compatibilityOptions.js.map +1 -0
- package/lib/webrtc/src/api/peerConfig.d.ts +547 -36
- package/lib/webrtc/src/api/peerConfig.js +187 -26
- package/lib/webrtc/src/api/peerConfig.js.map +1 -1
- package/lib/webrtc/src/api/peerConnectionEvents.d.ts +87 -2
- package/lib/webrtc/src/api/peerConnectionEvents.js +105 -1
- package/lib/webrtc/src/api/peerConnectionEvents.js.map +1 -1
- package/lib/webrtc/src/dataChannel.d.ts +122 -10
- package/lib/webrtc/src/dataChannel.js +214 -20
- package/lib/webrtc/src/dataChannel.js.map +1 -1
- package/lib/webrtc/src/helper.d.ts +8 -0
- package/lib/webrtc/src/helper.js +40 -4
- package/lib/webrtc/src/helper.js.map +1 -1
- package/lib/webrtc/src/media/codecCompatibility.d.ts +87 -1
- package/lib/webrtc/src/media/codecCompatibility.js +338 -12
- package/lib/webrtc/src/media/codecCompatibility.js.map +1 -1
- package/lib/webrtc/src/media/domEventTarget.d.ts +55 -0
- package/lib/webrtc/src/media/domEventTarget.js +216 -0
- package/lib/webrtc/src/media/domEventTarget.js.map +1 -0
- package/lib/webrtc/src/media/index.d.ts +2 -0
- package/lib/webrtc/src/media/index.js +1 -0
- package/lib/webrtc/src/media/index.js.map +1 -1
- package/lib/webrtc/src/media/parameters.d.ts +5 -0
- package/lib/webrtc/src/media/parameters.js +10 -0
- package/lib/webrtc/src/media/parameters.js.map +1 -1
- package/lib/webrtc/src/media/receiver/nack.d.ts +43 -10
- package/lib/webrtc/src/media/receiver/nack.js +245 -88
- package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.d.ts +10 -0
- package/lib/webrtc/src/media/receiver/receiverTwcc.js +4 -10
- package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
- package/lib/webrtc/src/media/router.d.ts +245 -51
- package/lib/webrtc/src/media/router.js +702 -237
- package/lib/webrtc/src/media/router.js.map +1 -1
- package/lib/webrtc/src/media/routing/pendingRoutes.d.ts +26 -0
- package/lib/webrtc/src/media/routing/pendingRoutes.js +48 -0
- package/lib/webrtc/src/media/routing/pendingRoutes.js.map +1 -0
- package/lib/webrtc/src/media/routing/ridRouting.d.ts +37 -0
- package/lib/webrtc/src/media/routing/ridRouting.js +74 -0
- package/lib/webrtc/src/media/routing/ridRouting.js.map +1 -0
- package/lib/webrtc/src/media/routing/routeTable.d.ts +60 -0
- package/lib/webrtc/src/media/routing/routeTable.js +95 -0
- package/lib/webrtc/src/media/routing/routeTable.js.map +1 -0
- package/lib/webrtc/src/media/routing/rtcpRouting.d.ts +34 -0
- package/lib/webrtc/src/media/routing/rtcpRouting.js +165 -0
- package/lib/webrtc/src/media/routing/rtcpRouting.js.map +1 -0
- package/lib/webrtc/src/media/routing/unknownSsrc.d.ts +55 -0
- package/lib/webrtc/src/media/routing/unknownSsrc.js +117 -0
- package/lib/webrtc/src/media/routing/unknownSsrc.js.map +1 -0
- package/lib/webrtc/src/media/rtpReceiver.d.ts +277 -5
- package/lib/webrtc/src/media/rtpReceiver.js +826 -36
- package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
- package/lib/webrtc/src/media/rtpSender.d.ts +8 -1
- package/lib/webrtc/src/media/rtpSender.js +13 -6
- package/lib/webrtc/src/media/rtpSender.js.map +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.d.ts +47 -11
- package/lib/webrtc/src/media/rtpTransceiver.js +95 -11
- package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
- package/lib/webrtc/src/media/sender/senderReportHistory.d.ts +51 -0
- package/lib/webrtc/src/media/sender/senderReportHistory.js +111 -0
- package/lib/webrtc/src/media/sender/senderReportHistory.js.map +1 -0
- package/lib/webrtc/src/media/sender/senderStats.d.ts +6 -5
- package/lib/webrtc/src/media/sender/senderStats.js +14 -19
- package/lib/webrtc/src/media/sender/senderStats.js.map +1 -1
- package/lib/webrtc/src/media/stats.d.ts +13 -0
- package/lib/webrtc/src/media/stats.js.map +1 -1
- package/lib/webrtc/src/media/track.d.ts +112 -11
- package/lib/webrtc/src/media/track.js +250 -19
- package/lib/webrtc/src/media/track.js.map +1 -1
- package/lib/webrtc/src/media/trackConstraints.d.ts +80 -0
- package/lib/webrtc/src/media/trackConstraints.js +141 -0
- package/lib/webrtc/src/media/trackConstraints.js.map +1 -0
- package/lib/webrtc/src/negotiation/internalState.d.ts +0 -4
- package/lib/webrtc/src/negotiation/internalState.js +0 -11
- package/lib/webrtc/src/negotiation/internalState.js.map +1 -1
- package/lib/webrtc/src/negotiation/remoteCandidates.d.ts +20 -1
- package/lib/webrtc/src/negotiation/remoteCandidates.js +29 -1
- package/lib/webrtc/src/negotiation/remoteCandidates.js.map +1 -1
- package/lib/webrtc/src/negotiation/remoteMediaApplication.d.ts +23 -6
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js +46 -22
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js.map +1 -1
- package/lib/webrtc/src/negotiation/transceiverPairing.d.ts +1 -0
- package/lib/webrtc/src/negotiation/transceiverPairing.js +62 -0
- package/lib/webrtc/src/negotiation/transceiverPairing.js.map +1 -0
- package/lib/webrtc/src/negotiation/transportActivation.d.ts +12 -1
- package/lib/webrtc/src/negotiation/transportActivation.js +133 -11
- package/lib/webrtc/src/negotiation/transportActivation.js.map +1 -1
- package/lib/webrtc/src/negotiationTransaction.d.ts +57 -5
- package/lib/webrtc/src/negotiationTransaction.js +134 -10
- package/lib/webrtc/src/negotiationTransaction.js.map +1 -1
- package/lib/webrtc/src/nonstandard/dummyMedia.d.ts +6 -0
- package/lib/webrtc/src/nonstandard/dummyMedia.js +14 -19
- package/lib/webrtc/src/nonstandard/dummyMedia.js.map +1 -1
- package/lib/webrtc/src/nonstandard/navigator.d.ts +1 -1
- package/lib/webrtc/src/nonstandard/recorder/index.js +5 -1
- package/lib/webrtc/src/nonstandard/recorder/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.d.ts +6 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +31 -2
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
- package/lib/webrtc/src/nonstandard/userMedia/packetizer.d.ts +16 -0
- package/lib/webrtc/src/nonstandard/userMedia/packetizer.js +25 -0
- package/lib/webrtc/src/nonstandard/userMedia/packetizer.js.map +1 -1
- package/lib/webrtc/src/nonstandard/userMedia.js +6 -13
- package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
- package/lib/webrtc/src/peerConnection.d.ts +106 -11
- package/lib/webrtc/src/peerConnection.js +370 -36
- package/lib/webrtc/src/peerConnection.js.map +1 -1
- package/lib/webrtc/src/polyfill/api.d.ts +2 -1
- package/lib/webrtc/src/polyfill/api.js +3 -3
- package/lib/webrtc/src/polyfill/api.js.map +1 -1
- package/lib/webrtc/src/polyfill/dom.d.ts +21 -7
- package/lib/webrtc/src/polyfill/dom.js +15 -0
- package/lib/webrtc/src/polyfill/dom.js.map +1 -1
- package/lib/webrtc/src/polyfill/globals.d.ts +8 -3
- package/lib/webrtc/src/polyfill/globals.js.map +1 -1
- package/lib/webrtc/src/polyfill/index.d.ts +1 -1
- package/lib/webrtc/src/polyfill/index.js +1 -1
- package/lib/webrtc/src/polyfill/index.js.map +1 -1
- package/lib/webrtc/src/polyfill/install.d.ts +5 -1
- package/lib/webrtc/src/polyfill/install.js +4 -2
- package/lib/webrtc/src/polyfill/install.js.map +1 -1
- package/lib/webrtc/src/polyfill/mediaDevices.js +28 -4
- package/lib/webrtc/src/polyfill/mediaDevices.js.map +1 -1
- package/lib/webrtc/src/polyfill/peerConnectionConfig.d.ts +6 -0
- package/lib/webrtc/src/polyfill/peerConnectionConfig.js +15 -4
- package/lib/webrtc/src/polyfill/peerConnectionConfig.js.map +1 -1
- package/lib/webrtc/src/polyfill/selectSettings.d.ts +4 -14
- package/lib/webrtc/src/polyfill/selectSettings.js +10 -106
- package/lib/webrtc/src/polyfill/selectSettings.js.map +1 -1
- package/lib/webrtc/src/polyfill/sourceIo.d.ts +1 -2
- package/lib/webrtc/src/polyfill/sourceIo.js +6 -6
- package/lib/webrtc/src/polyfill/sourceIo.js.map +1 -1
- package/lib/webrtc/src/sctpManager.d.ts +31 -18
- package/lib/webrtc/src/sctpManager.js +162 -38
- package/lib/webrtc/src/sctpManager.js.map +1 -1
- package/lib/webrtc/src/sdp.d.ts +107 -2
- package/lib/webrtc/src/sdp.js +223 -17
- package/lib/webrtc/src/sdp.js.map +1 -1
- package/lib/webrtc/src/sdpManager.d.ts +101 -10
- package/lib/webrtc/src/sdpManager.js +236 -14
- package/lib/webrtc/src/sdpManager.js.map +1 -1
- package/lib/webrtc/src/secureTransportManager.d.ts +49 -3
- package/lib/webrtc/src/secureTransportManager.js +166 -12
- package/lib/webrtc/src/secureTransportManager.js.map +1 -1
- package/lib/webrtc/src/transceiverManager.d.ts +87 -6
- package/lib/webrtc/src/transceiverManager.js +272 -51
- package/lib/webrtc/src/transceiverManager.js.map +1 -1
- package/lib/webrtc/src/transport/dtls-application-gate.d.ts +1 -0
- package/lib/webrtc/src/transport/dtls-application-gate.js +143 -0
- package/lib/webrtc/src/transport/dtls-application-gate.js.map +1 -0
- package/lib/webrtc/src/transport/dtls-attempt.d.ts +1 -0
- package/lib/webrtc/src/transport/dtls-attempt.js +79 -0
- package/lib/webrtc/src/transport/dtls-attempt.js.map +1 -0
- package/lib/webrtc/src/transport/dtls-certificate.d.ts +24 -0
- package/lib/webrtc/src/transport/dtls-certificate.js +98 -0
- package/lib/webrtc/src/transport/dtls-certificate.js.map +1 -0
- package/lib/webrtc/src/transport/dtls-fingerprint.d.ts +7 -0
- package/lib/webrtc/src/transport/dtls-fingerprint.js +66 -0
- package/lib/webrtc/src/transport/dtls-fingerprint.js.map +1 -0
- package/lib/webrtc/src/transport/dtls-ice-transport.d.ts +1 -0
- package/lib/webrtc/src/transport/dtls-ice-transport.js +123 -0
- package/lib/webrtc/src/transport/dtls-ice-transport.js.map +1 -0
- package/lib/webrtc/src/transport/dtls-media-queue.d.ts +1 -0
- package/lib/webrtc/src/transport/dtls-media-queue.js +95 -0
- package/lib/webrtc/src/transport/dtls-media-queue.js.map +1 -0
- package/lib/webrtc/src/transport/dtls-readiness.d.ts +1 -0
- package/lib/webrtc/src/transport/dtls-readiness.js +173 -0
- package/lib/webrtc/src/transport/dtls-readiness.js.map +1 -0
- package/lib/webrtc/src/transport/dtls-sped-handshake.d.ts +1 -0
- package/lib/webrtc/src/transport/dtls-sped-handshake.js +146 -0
- package/lib/webrtc/src/transport/dtls-sped-handshake.js.map +1 -0
- package/lib/webrtc/src/transport/dtls-srtp.d.ts +1 -0
- package/lib/webrtc/src/transport/dtls-srtp.js +133 -0
- package/lib/webrtc/src/transport/dtls-srtp.js.map +1 -0
- package/lib/webrtc/src/transport/dtls-stats.d.ts +1 -0
- package/lib/webrtc/src/transport/dtls-stats.js +134 -0
- package/lib/webrtc/src/transport/dtls-stats.js.map +1 -0
- package/lib/webrtc/src/transport/dtls-types.d.ts +23 -0
- package/lib/webrtc/src/transport/dtls-types.js +11 -0
- package/lib/webrtc/src/transport/dtls-types.js.map +1 -0
- package/lib/webrtc/src/transport/dtls.d.ts +236 -47
- package/lib/webrtc/src/transport/dtls.js +1198 -441
- package/lib/webrtc/src/transport/dtls.js.map +1 -1
- package/lib/webrtc/src/transport/ice.d.ts +95 -5
- package/lib/webrtc/src/transport/ice.js +323 -21
- package/lib/webrtc/src/transport/ice.js.map +1 -1
- package/lib/webrtc/src/transport/iceCandidateAttribute.d.ts +4 -2
- package/lib/webrtc/src/transport/iceCandidateAttribute.js.map +1 -1
- package/lib/webrtc/src/transport/sctp.d.ts +149 -2
- package/lib/webrtc/src/transport/sctp.js +826 -128
- package/lib/webrtc/src/transport/sctp.js.map +1 -1
- package/lib/webrtc/src/transport/sped.d.ts +139 -0
- package/lib/webrtc/src/transport/sped.js +757 -0
- package/lib/webrtc/src/transport/sped.js.map +1 -0
- package/lib/webrtc/src/types/util.d.ts +6 -0
- package/lib/webrtc/src/types/util.js.map +1 -1
- package/lib/webrtc/src/utils.d.ts +34 -1
- package/lib/webrtc/src/utils.js +52 -3
- package/lib/webrtc/src/utils.js.map +1 -1
- package/lib/webrtc/src/webidl.d.ts +15 -0
- package/lib/webrtc/src/webidl.js +34 -0
- package/lib/webrtc/src/webidl.js.map +1 -0
- package/package.json +8 -3
- package/lib/webrtc/src/polyfill/rtcSessionDescription.d.ts +0 -18
- package/lib/webrtc/src/polyfill/rtcSessionDescription.js +0 -36
- package/lib/webrtc/src/polyfill/rtcSessionDescription.js.map +0 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { Address, InterfaceAddresses, TlsConnectionOptions } from "../imports/common";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DtlsVersion } from "../imports/dtls";
|
|
3
|
+
import type { CandidatePair, IceFailoverOptions, Message, MessageIntegrityMode, Protocol } from "../imports/ice";
|
|
3
4
|
import type { RTCRtpCodecParameters, RTCRtpHeaderExtensionParameters } from "../media/parameters";
|
|
4
|
-
import {
|
|
5
|
+
import type { KeyFrameRequestRouting } from "../media/router";
|
|
5
6
|
import type { RTCRtpSenderOptions } from "../media/rtpSender";
|
|
6
7
|
import type { BandwidthEstimatorOption } from "../media/sender/createBandwidthEstimator";
|
|
7
8
|
import type { BundlePolicy } from "../sdp";
|
|
8
|
-
import type
|
|
9
|
+
import { type BundleCandidates, type MLineReuse } from "../sdpManager";
|
|
9
10
|
import type { DtlsKeys, RTCCertificate } from "../transport/dtls";
|
|
11
|
+
import { type CompatibilityOptionValue } from "./compatibilityOptions";
|
|
10
12
|
export type DebugConfig = Partial<{
|
|
11
13
|
/**% */
|
|
12
14
|
inboundPacketLoss: number;
|
|
@@ -53,11 +55,29 @@ export interface PeerConfig {
|
|
|
53
55
|
* VPN, ...). If the bind fails, the family has no UDP host candidate.
|
|
54
56
|
* A family left unspecified while the other one is set gathers no
|
|
55
57
|
* enumerated addresses (only its `iceAdditionalHostAddresses`).
|
|
58
|
+
*
|
|
59
|
+
* When unset, each enumerated interface address gets a UDP host socket
|
|
60
|
+
* bound to that address, so connectivity checks leave from the advertised
|
|
61
|
+
* candidate on multi-NIC hosts. An address whose bind fails is not
|
|
62
|
+
* advertised. VPN / tunnel interfaces (`tun`, `utun`, `ipsec`, `tap`) are
|
|
63
|
+
* gathered with a low priority and the default-route address with the
|
|
64
|
+
* highest: the source address of the route to the configured STUN / TURN
|
|
65
|
+
* server (without one, no address is preferred and nothing else is probed).
|
|
66
|
+
* With a STUN server, one more socket per family is bound to the
|
|
67
|
+
* wildcard address: it advertises no host candidate but maps the route the
|
|
68
|
+
* OS picks (server-reflexive candidate with `raddr 0.0.0.0`).
|
|
69
|
+
* `setLocalDescription()` waits only for that socket and the
|
|
70
|
+
* default-route one; the other interfaces' server-reflexive candidates
|
|
71
|
+
* trickle through `onicecandidate` before the end-of-candidates `null`.
|
|
72
|
+
* Set a family to `0.0.0.0` / `::` to gather its enumerated addresses over
|
|
73
|
+
* wildcard sockets instead.
|
|
56
74
|
*/
|
|
57
75
|
iceInterfaceAddresses: InterfaceAddresses | undefined;
|
|
58
76
|
/** Add additional host (local) addresses to use for candidate gathering.
|
|
59
|
-
* Notably, you can include hosts that are normally excluded, such as loopback,
|
|
77
|
+
* Notably, you can include hosts that are normally excluded, such as loopback, vmnet / veth interfaces, etc.
|
|
60
78
|
* For a family bound by `iceInterfaceAddresses`, addresses other than the bound one are ignored.
|
|
79
|
+
* An address assigned to a local interface is bound like an enumerated one; any other address
|
|
80
|
+
* (a 1:1 NAT public address, for example) is gathered over a wildcard socket.
|
|
61
81
|
*/
|
|
62
82
|
iceAdditionalHostAddresses: string[] | undefined;
|
|
63
83
|
iceUseIpv4: boolean;
|
|
@@ -67,7 +87,8 @@ export interface PeerConfig {
|
|
|
67
87
|
iceTcpPassive: boolean;
|
|
68
88
|
/**
|
|
69
89
|
* Seconds to wait for server-reflexive candidates while gathering.
|
|
70
|
-
* Defaults to 5 when undefined.
|
|
90
|
+
* Defaults to 5 when undefined. `setLocalDescription()` waits for it only
|
|
91
|
+
* on the wildcard and default-route sockets (see `iceInterfaceAddresses`).
|
|
71
92
|
*/
|
|
72
93
|
iceStunGatherTimeout: number | undefined;
|
|
73
94
|
/**
|
|
@@ -75,6 +96,57 @@ export interface PeerConfig {
|
|
|
75
96
|
* Defaults to 8 when undefined.
|
|
76
97
|
*/
|
|
77
98
|
iceTurnConnectTimeout: number | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Seconds ICE waits for a connectivity check from the peer when it has no
|
|
101
|
+
* candidate pair of its own to check after both sides ended their
|
|
102
|
+
* candidates (the peer offered only active TCP candidates, as Firefox does
|
|
103
|
+
* for ICE-TCP, or none werift can reach). Without a check in that time the
|
|
104
|
+
* ICE transport fails. With `iceLite`, which sends no checks, ICE waits the
|
|
105
|
+
* same time whenever it has no candidate pair, also while it still
|
|
106
|
+
* gathers. The deadline is fixed when the wait begins; once gathering ended
|
|
107
|
+
* without a socket that could receive a check, ICE fails at once. Defaults
|
|
108
|
+
* to 30 when undefined; 0 fails at once.
|
|
109
|
+
*/
|
|
110
|
+
iceIncomingCheckTimeout: number | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* werift extension. With `iceNomination: "regular"`: milliseconds the
|
|
113
|
+
* controlling ICE agent keeps checking before it nominates a candidate pair,
|
|
114
|
+
* so a higher-priority candidate trickled shortly after a lower-priority one
|
|
115
|
+
* succeeded can still be selected. Maps to `IceOptions.nominationDelayMs`:
|
|
116
|
+
* 300 when undefined, 0 nominates the first valid pair at once.
|
|
117
|
+
*/
|
|
118
|
+
iceNominationDelayMs: number | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* werift extension. How the controlling ICE agent nominates toward a full
|
|
121
|
+
* ICE peer (`IceOptions.nomination`). `"semi-aggressive"` (default when
|
|
122
|
+
* undefined, as Chrome): the first pair whose check succeeds is selected at
|
|
123
|
+
* once and a higher-priority pair that succeeds later replaces it.
|
|
124
|
+
* `"regular"`: RFC 8445 regular nomination, one nomination after
|
|
125
|
+
* `iceNominationDelayMs`.
|
|
126
|
+
*/
|
|
127
|
+
iceNomination: "semi-aggressive" | "regular" | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* werift extension. Enable ICE renomination
|
|
130
|
+
* (draft-thatcher-ice-renomination, as libwebrtc implements it): every
|
|
131
|
+
* description advertises `a=ice-options:trickle renomination`. When the
|
|
132
|
+
* remote description advertises `renomination` too, the controlling agent
|
|
133
|
+
* nominates with the NOMINATION STUN attribute and an increasing value, so
|
|
134
|
+
* a later, better pair reliably replaces the selection on both sides
|
|
135
|
+
* (`IceOptions.renomination`). Chrome advertises it only when its SDP is
|
|
136
|
+
* modified before `setLocalDescription`; as the controlled side it honours
|
|
137
|
+
* the attribute regardless. Defaults to false.
|
|
138
|
+
*/
|
|
139
|
+
iceRenomination: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* werift extension. Thresholds of the failover of the selected candidate
|
|
142
|
+
* pair without an ICE restart (with semi-aggressive nomination or
|
|
143
|
+
* renomination): how soon a pair is unwritable (`unwritableMinChecks`,
|
|
144
|
+
* `unwritableTimeout`) and how soon a selected pair that stopped receiving
|
|
145
|
+
* moves to a backup (`receivingTimeout`, `receivingSwitchingDelay`). Maps
|
|
146
|
+
* to `IceOptions.failover`; each unset or invalid value keeps its default
|
|
147
|
+
* (libwebrtc's: 5 checks, 5000 ms, 2500 ms, 1000 ms).
|
|
148
|
+
*/
|
|
149
|
+
iceFailover: IceFailoverOptions | undefined;
|
|
78
150
|
turnTransport: "udp" | "tcp" | "tls" | undefined;
|
|
79
151
|
turnTlsOptions: TlsConnectionOptions | undefined;
|
|
80
152
|
/**
|
|
@@ -91,8 +163,82 @@ export interface PeerConfig {
|
|
|
91
163
|
* Return `true` if a STUN response should be sent, false if it should be skipped. */
|
|
92
164
|
iceFilterStunResponse: ((message: Message, addr: Address, protocol: Protocol) => boolean) | undefined;
|
|
93
165
|
iceFilterCandidatePair: ((pair: CandidatePair) => boolean) | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Opt-in SPED (DTLS handshake embedded in ICE Binding).
|
|
168
|
+
* Omit or false: ICE completes, then DTLS starts (current serial path).
|
|
169
|
+
* true: this PeerConnection only overlaps ICE checks with DTLS 1.3 handshake.
|
|
170
|
+
* Requires explicit DTLS 1.3 in `dtls.protocolVersions`
|
|
171
|
+
* (`dtls.protocolVersions` defaults to empty / DTLS 1.2 only).
|
|
172
|
+
* Cannot be combined with `dtls.helloRetryRequest: true`
|
|
173
|
+
* (SPED uses ICE-authenticated address validation, not a DTLS cookie).
|
|
174
|
+
* Both are validated by the constructor and `setConfiguration()`, which
|
|
175
|
+
* throw synchronously and leave the configuration unchanged.
|
|
176
|
+
*/
|
|
177
|
+
sped?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* WARP early outbound and encrypted-media buffering policy.
|
|
180
|
+
* - `allowEarlyServerData` (default false): the DTLS server may send
|
|
181
|
+
* application data / media before the SDP fingerprint is verified.
|
|
182
|
+
* Requires {@link PeerConfig.sped} `true` and DTLS 1.3; the constructor
|
|
183
|
+
* and `setConfiguration()` throw synchronously otherwise.
|
|
184
|
+
* - `earlyMediaPolicy` (default `"drop"`): `"buffer"` retains inbound
|
|
185
|
+
* encrypted media received before authentication (bounded) instead of
|
|
186
|
+
* dropping it. Inbound data is never delivered before authentication.
|
|
187
|
+
* - `sendBeforeNomination` (default false): once the DTLS handshake is
|
|
188
|
+
* done on this side (the DTLS client right after its Finished) and the
|
|
189
|
+
* peer is authenticated, send application data and media on a valid
|
|
190
|
+
* candidate pair (its own connectivity check succeeded) instead of
|
|
191
|
+
* waiting for ICE nomination and consent (RFC 8445 §12.1, SPED
|
|
192
|
+
* draft-00 §3.1.2.2). Applies only until a selected pair exists; never
|
|
193
|
+
* during an ICE restart or on relay pairs. A peer that drops data
|
|
194
|
+
* arriving before its own nomination only loses it like any packet loss
|
|
195
|
+
* (SCTP retransmits). Requires {@link PeerConfig.sped} `true`; the
|
|
196
|
+
* constructor and `setConfiguration()` throw synchronously otherwise.
|
|
197
|
+
* `setConfiguration()` merges these fields and applies them to every open
|
|
198
|
+
* DTLS transport, including ones a pending description prepared.
|
|
199
|
+
*/
|
|
200
|
+
warp?: {
|
|
201
|
+
allowEarlyServerData?: boolean;
|
|
202
|
+
earlyMediaPolicy?: "drop" | "buffer";
|
|
203
|
+
sendBeforeNomination?: boolean;
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Integrity attributes of the ICE connectivity checks and consent requests
|
|
207
|
+
* werift sends (RFC 8489 short-term credentials). Applies to ICE transports
|
|
208
|
+
* created after it is set.
|
|
209
|
+
* - `undefined` / `"sha1"` (default): MESSAGE-INTEGRITY only. Browsers
|
|
210
|
+
* (libwebrtc, Firefox) accept this.
|
|
211
|
+
* - `"sha256"`: MESSAGE-INTEGRITY-SHA256 only. Only for peers known to
|
|
212
|
+
* support it: a peer that does not know the attribute rejects the checks.
|
|
213
|
+
* - `"both"`: MESSAGE-INTEGRITY followed by MESSAGE-INTEGRITY-SHA256.
|
|
214
|
+
*
|
|
215
|
+
* Checks and responses from the peer are accepted with either algorithm,
|
|
216
|
+
* and responses are always signed with the algorithm of the request.
|
|
217
|
+
*/
|
|
218
|
+
iceMessageIntegrity: MessageIntegrityMode | undefined;
|
|
219
|
+
/**
|
|
220
|
+
* Advertise the `ice2` ice-option (`a=ice-options:trickle ice2`, RFC 8445
|
|
221
|
+
* §10 / RFC 8839) to declare an RFC 8445 agent. Defaults to false
|
|
222
|
+
* (`a=ice-options:trickle`). It is only a declaration: werift runs the
|
|
223
|
+
* RFC 8445 procedures either way. Cannot be changed after construction.
|
|
224
|
+
*/
|
|
225
|
+
iceOptionIce2: boolean;
|
|
94
226
|
dtls: Partial<{
|
|
95
227
|
keys: DtlsKeys;
|
|
228
|
+
/**
|
|
229
|
+
* DTLS protocol versions in preference order.
|
|
230
|
+
* Unspecified / empty keeps DTLS 1.2 only. DTLS 1.3 requires explicit opt-in.
|
|
231
|
+
* Independent of {@link PeerConfig.sped} (SPED also requires DTLS 1.3; validated by the constructor / setConfiguration()).
|
|
232
|
+
*/
|
|
233
|
+
protocolVersions: readonly DtlsVersion[];
|
|
234
|
+
/**
|
|
235
|
+
* DTLS 1.3 HelloRetryRequest cookie exchange.
|
|
236
|
+
* Default false: ICE-authenticated path omits cookie HRR and saves 1 RTT.
|
|
237
|
+
* true: send a cookie-bearing HRR (mapped internally to addressValidation: "dtls-cookie").
|
|
238
|
+
* Group-only HRR for key_share correction is independent of this option.
|
|
239
|
+
* Cannot be combined with {@link PeerConfig.sped} `true`.
|
|
240
|
+
*/
|
|
241
|
+
helloRetryRequest?: boolean;
|
|
96
242
|
}>;
|
|
97
243
|
icePasswordPrefix: string | undefined;
|
|
98
244
|
bundlePolicy: BundlePolicy;
|
|
@@ -100,18 +246,39 @@ export interface PeerConfig {
|
|
|
100
246
|
iceCandidatePoolSize: number;
|
|
101
247
|
certificates: RTCCertificate[];
|
|
102
248
|
/**
|
|
103
|
-
* Which default DTLS certificate is used when neither `certificates` nor `dtls.keys` is given
|
|
104
|
-
* Cannot be changed after construction.
|
|
105
|
-
* - `"process"` (default): one certificate shared by every RTCPeerConnection in the process
|
|
106
|
-
*
|
|
107
|
-
* - `"
|
|
249
|
+
* Which default DTLS certificate is used when neither `certificates` nor `dtls.keys` is given
|
|
250
|
+
* (see {@link CompatibilityOptionValues}). Cannot be changed after construction.
|
|
251
|
+
* - `"process"` (default): one certificate shared by every RTCPeerConnection in the process,
|
|
252
|
+
* so their `a=fingerprint` values are identical.
|
|
253
|
+
* - `"standard"`: each RTCPeerConnection generates its own certificate, as browsers do.
|
|
108
254
|
* All DTLS transports of that connection share it.
|
|
255
|
+
*
|
|
256
|
+
* Also accepts the v0.27.0 name `"peerConnection"` (= `"standard"`).
|
|
109
257
|
*/
|
|
110
258
|
certificateScope: CertificateScope;
|
|
111
259
|
debug: DebugConfig;
|
|
112
260
|
midSuffix: boolean;
|
|
113
261
|
/** Advertised local SCTP max-message-size in SDP. Use 0 for unlimited. */
|
|
114
262
|
maxMessageSize: number;
|
|
263
|
+
/**
|
|
264
|
+
* The initial `binaryType` of every data channel this connection creates,
|
|
265
|
+
* by `createDataChannel()` or announced by the remote peer (a compatibility
|
|
266
|
+
* option, see {@link CompatibilityOptionValues} and
|
|
267
|
+
* {@link RTCDataChannelBinaryType}).
|
|
268
|
+
* - `"nodebuffer"` (default, werift's own value): binary messages arrive as
|
|
269
|
+
* a Node.js `Buffer`, as before this option existed.
|
|
270
|
+
* - `"standard"`: the browser default, `"arraybuffer"` (W3C); the channel's
|
|
271
|
+
* `binaryType` reads `"arraybuffer"`.
|
|
272
|
+
* - `"arraybuffer"` / `"blob"`: binary messages arrive as an `ArrayBuffer`
|
|
273
|
+
* / a `Blob` (`werift/polyfill` uses `"arraybuffer"`).
|
|
274
|
+
*
|
|
275
|
+
* Another value is a `TypeError`. `compatibility: "standard"` sets it to
|
|
276
|
+
* `"standard"` when it is not given. `setConfiguration()` may change it; the
|
|
277
|
+
* new value applies to channels created afterwards, and an existing
|
|
278
|
+
* channel changes with its own `binaryType` setter.
|
|
279
|
+
* @see tests/datachannel/binaryType.test.ts "dataChannelBinaryType: standard gives channels the W3C default arraybuffer"
|
|
280
|
+
*/
|
|
281
|
+
dataChannelBinaryType: DataChannelBinaryTypeOption;
|
|
115
282
|
/**
|
|
116
283
|
* When true, padding-only RTP is omitted from onReceiveRtp and later media
|
|
117
284
|
* sequence numbers are compacted. Default false preserves wire RTP events.
|
|
@@ -129,21 +296,144 @@ export interface PeerConfig {
|
|
|
129
296
|
*/
|
|
130
297
|
pendingRtp: NonNullable<RTCRtpSenderOptions["pendingRtp"]>;
|
|
131
298
|
/**
|
|
132
|
-
* How local SDP marks inactive / stopped m-lines
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* and
|
|
136
|
-
*
|
|
299
|
+
* How local SDP marks inactive / stopped m-lines (see {@link CompatibilityOptionValues}).
|
|
300
|
+
* Cannot be changed after construction.
|
|
301
|
+
* - `"standard"` (default): an accepted `inactive` m-line keeps a non-zero port, as JSEP
|
|
302
|
+
* and browsers do. Only rejected (no common codec / remote port 0) or stopped m-lines
|
|
303
|
+
* use port 0, and only those negotiated port 0 positions are reused by new transceivers.
|
|
304
|
+
* - `"aggressive"`: behavior before v0.25.0. `inactive` m-lines are also written with
|
|
305
|
+
* port 0, so the remote side treats them as rejected and their positions are reused.
|
|
306
|
+
*
|
|
307
|
+
* Also accepts the v0.27.0 name `"compatible"` (= `"standard"`).
|
|
137
308
|
*/
|
|
138
309
|
mLineReuse: MLineReuse;
|
|
139
310
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
311
|
+
* How a remote offer's m-sections are paired with local transceivers that
|
|
312
|
+
* have no MID yet (see {@link CompatibilityOptionValues}). Cannot be changed
|
|
313
|
+
* after construction.
|
|
314
|
+
* - `"byKind"` (default): behavior up to v0.27.0. Any unassociated,
|
|
315
|
+
* non-stopped transceiver of the same kind is paired (the one at the same
|
|
316
|
+
* m-line index first), whatever created it. In glare (perfect negotiation)
|
|
317
|
+
* the remote offer can take over a transceiver created with
|
|
318
|
+
* `addTransceiver(kind, { direction: "sendonly" })` and its direction
|
|
319
|
+
* becomes `sendrecv`.
|
|
320
|
+
* - `"standard"`: RFC 8829 (JSEP) section 5.10, as browsers do. An
|
|
321
|
+
* m-section whose MID no transceiver has is associated only with an
|
|
322
|
+
* unassociated, non-stopped transceiver of the same kind that
|
|
323
|
+
* `addTrack()` created (or one a rollback promoted to that, JSEP 4.1.8.2),
|
|
324
|
+
* and only when the m-section is `sendrecv` or `recvonly`. A transceiver
|
|
325
|
+
* created by `addTransceiver()` (with or without a track, also after
|
|
326
|
+
* `replaceTrack()` or a later `addTrack()` reusing it) is never paired:
|
|
327
|
+
* the offer gets a new transceiver, and the local one keeps its direction
|
|
328
|
+
* and `mid === null` until a local offer negotiates it. Use it for the
|
|
329
|
+
* perfect negotiation pattern and for code written for browsers.
|
|
330
|
+
*/
|
|
331
|
+
transceiverPairing: TransceiverPairing;
|
|
332
|
+
/**
|
|
333
|
+
* Where a PLI / FIR goes when no route has its target SSRC (see
|
|
334
|
+
* {@link CompatibilityOptionValues} and {@link KeyFrameRequestRouting}).
|
|
335
|
+
* `setConfiguration()` may change it.
|
|
336
|
+
* - `"fallback"` (default): the sender whose RTX SSRC it is, else the only video sender.
|
|
337
|
+
* - `"standard"`: not delivered, as RFC 4585 / RFC 5104 define the target.
|
|
338
|
+
*
|
|
339
|
+
* Also accepts the names up to v0.27.0: `"compatible"` (= `"fallback"`) and
|
|
340
|
+
* `"strict"` (= `"standard"`).
|
|
143
341
|
*/
|
|
144
342
|
keyFrameRequestRouting: KeyFrameRequestRouting;
|
|
343
|
+
/**
|
|
344
|
+
* How strictly the DTLS 1.2 handshake validates the peer's messages (see
|
|
345
|
+
* {@link CompatibilityOptionValues}). Cannot be changed after construction.
|
|
346
|
+
* - `"lenient"` (default): a malformed `supported_versions` is ignored and
|
|
347
|
+
* DTLS 1.2 negotiated, duplicate extensions are accepted and `use_srtp`
|
|
348
|
+
* is read without length checks, as before the strict checks.
|
|
349
|
+
* - `"standard"`: RFC-strict; these fail the handshake (a malformed
|
|
350
|
+
* `supported_versions` with a `protocol_version` alert).
|
|
351
|
+
*
|
|
352
|
+
* A `supported_versions` without an overlapping version fails either way,
|
|
353
|
+
* and DTLS 1.3 always validates strictly.
|
|
354
|
+
*/
|
|
355
|
+
dtlsHandshakeValidation: DtlsHandshakeValidation;
|
|
356
|
+
/**
|
|
357
|
+
* Which m-lines of a BUNDLE group carry the local ICE candidates.
|
|
358
|
+
* Cannot be changed after construction. See {@link BundleCandidates}.
|
|
359
|
+
* - `"legacy"` (default): every m-line repeats its transport's candidates and
|
|
360
|
+
* `a=end-of-candidates` (werift's earlier output).
|
|
361
|
+
* - `"compatible"`: as Chrome writes them, only the BUNDLE tag m-line carries
|
|
362
|
+
* them, so renegotiation with more m-lines no longer repeats the candidate list.
|
|
363
|
+
*/
|
|
364
|
+
bundleCandidates: BundleCandidates;
|
|
365
|
+
/**
|
|
366
|
+
* Sets every compatibility option (`certificateScope`, `mLineReuse`,
|
|
367
|
+
* `transceiverPairing`, `keyFrameRequestRouting`,
|
|
368
|
+
* `dtlsHandshakeValidation`, `dataChannelBinaryType`, see
|
|
369
|
+
* {@link CompatibilityOptionValues}) to the specification / browser behavior
|
|
370
|
+
* at once. Cannot be changed after construction.
|
|
371
|
+
* - `undefined` (default): each option keeps its own default.
|
|
372
|
+
* - `"standard"`: every compatibility option not given in the same
|
|
373
|
+
* configuration is `"standard"`.
|
|
374
|
+
*
|
|
375
|
+
* An option given explicitly always takes precedence over `compatibility`:
|
|
376
|
+
* a value given in the same configuration (an old name included) is kept,
|
|
377
|
+
* and `setConfiguration()` treats the options as if `compatibility` were
|
|
378
|
+
* not set (`keyFrameRequestRouting` and `dataChannelBinaryType` may
|
|
379
|
+
* change, the others cannot). An
|
|
380
|
+
* option given as `undefined` counts as not given.
|
|
381
|
+
*
|
|
382
|
+
* ```ts
|
|
383
|
+
* new RTCPeerConnection({ compatibility: "standard" });
|
|
384
|
+
* // certificateScope, mLineReuse, transceiverPairing,
|
|
385
|
+
* // keyFrameRequestRouting, dtlsHandshakeValidation and
|
|
386
|
+
* // dataChannelBinaryType are all "standard"
|
|
387
|
+
* new RTCPeerConnection({ compatibility: "standard", certificateScope: "process" });
|
|
388
|
+
* // certificateScope is "process", the others are "standard"
|
|
389
|
+
* ```
|
|
390
|
+
*
|
|
391
|
+
* It does not change `iceServers` / `iceUseDefaultStunServer`, which are not
|
|
392
|
+
* compatibility options.
|
|
393
|
+
* @see tests/datachannel/binaryType.test.ts "compatibility: standard makes data channels deliver ArrayBuffer unless dataChannelBinaryType is given"
|
|
394
|
+
*/
|
|
395
|
+
compatibility: CompatibilityPreset | undefined;
|
|
145
396
|
}
|
|
146
|
-
|
|
397
|
+
/** Which default DTLS certificate is used. See {@link PeerConfig.certificateScope}. */
|
|
398
|
+
export type CertificateScope = CompatibilityOptionValue<"certificateScope">;
|
|
399
|
+
export declare const CertificateScopeModes: readonly CertificateScope[];
|
|
400
|
+
/** How local SDP marks inactive / stopped m-lines. See {@link PeerConfig.mLineReuse}. */
|
|
401
|
+
export declare const MLineReuseModes: readonly MLineReuse[];
|
|
402
|
+
/** How a remote offer pairs m-sections with local transceivers. See {@link PeerConfig.transceiverPairing}. */
|
|
403
|
+
export type TransceiverPairing = CompatibilityOptionValue<"transceiverPairing">;
|
|
404
|
+
export declare const TransceiverPairingModes: readonly TransceiverPairing[];
|
|
405
|
+
/** How strictly the DTLS 1.2 handshake validates the peer. See {@link PeerConfig.dtlsHandshakeValidation}. */
|
|
406
|
+
export type DtlsHandshakeValidation = CompatibilityOptionValue<"dtlsHandshakeValidation">;
|
|
407
|
+
export declare const DtlsHandshakeValidationModes: readonly DtlsHandshakeValidation[];
|
|
408
|
+
/** The initial `binaryType` of new data channels. See {@link PeerConfig.dataChannelBinaryType}. */
|
|
409
|
+
export type DataChannelBinaryTypeOption = CompatibilityOptionValue<"dataChannelBinaryType">;
|
|
410
|
+
export declare const DataChannelBinaryTypeModes: readonly DataChannelBinaryTypeOption[];
|
|
411
|
+
/** The values of {@link PeerConfig.compatibility}. */
|
|
412
|
+
export type CompatibilityPreset = "standard";
|
|
413
|
+
export declare const CompatibilityPresets: readonly CompatibilityPreset[];
|
|
414
|
+
/**
|
|
415
|
+
* The values the compatibility options used up to v0.27.0 that are not
|
|
416
|
+
* values any more, and the value each one is read as. They are accepted on
|
|
417
|
+
* input only: `getConfiguration()` returns the current name.
|
|
418
|
+
*/
|
|
419
|
+
export declare const DeprecatedCompatibilityValues: {
|
|
420
|
+
readonly certificateScope: {
|
|
421
|
+
readonly peerConnection: "standard";
|
|
422
|
+
};
|
|
423
|
+
readonly mLineReuse: {
|
|
424
|
+
readonly compatible: "standard";
|
|
425
|
+
};
|
|
426
|
+
readonly keyFrameRequestRouting: {
|
|
427
|
+
readonly compatible: "fallback";
|
|
428
|
+
readonly strict: "standard";
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
/** @deprecated Use `"standard"` (`"peerConnection"`). */
|
|
432
|
+
export type DeprecatedCertificateScope = keyof (typeof DeprecatedCompatibilityValues)["certificateScope"];
|
|
433
|
+
/** @deprecated Use `"standard"` (`"compatible"`). */
|
|
434
|
+
export type DeprecatedMLineReuse = keyof (typeof DeprecatedCompatibilityValues)["mLineReuse"];
|
|
435
|
+
/** @deprecated Use `"fallback"` (`"compatible"`) or `"standard"` (`"strict"`). */
|
|
436
|
+
export type DeprecatedKeyFrameRequestRouting = keyof (typeof DeprecatedCompatibilityValues)["keyFrameRequestRouting"];
|
|
147
437
|
export declare const findCodecByMimeType: (codecs: RTCRtpCodecParameters[], target: RTCRtpCodecParameters) => RTCRtpCodecParameters | undefined;
|
|
148
438
|
export type RTCIceServer = {
|
|
149
439
|
urls: string | string[];
|
|
@@ -167,10 +457,17 @@ export interface RTCConfiguration {
|
|
|
167
457
|
type RTCPeerConnectionRTCConfiguration = Omit<RTCConfiguration, "bundlePolicy"> & {
|
|
168
458
|
bundlePolicy?: PeerConfig["bundlePolicy"] | RTCBundlePolicy;
|
|
169
459
|
};
|
|
170
|
-
export type RTCPeerConnectionConfig = Partial<Omit<PeerConfig, "bundlePolicy" | "rtcpMuxPolicy" | "iceCandidatePoolSize" | "certificates" | "sctp">> & RTCPeerConnectionRTCConfiguration & {
|
|
460
|
+
export type RTCPeerConnectionConfig = Partial<Omit<PeerConfig, "bundlePolicy" | "rtcpMuxPolicy" | "iceCandidatePoolSize" | "certificates" | "sctp" | "certificateScope" | "mLineReuse" | "keyFrameRequestRouting">> & RTCPeerConnectionRTCConfiguration & {
|
|
171
461
|
sctp?: RTCSctpConfiguration;
|
|
462
|
+
/** See {@link PeerConfig.certificateScope}. */
|
|
463
|
+
certificateScope?: CertificateScope | DeprecatedCertificateScope;
|
|
464
|
+
/** See {@link PeerConfig.mLineReuse}. */
|
|
465
|
+
mLineReuse?: MLineReuse | DeprecatedMLineReuse;
|
|
466
|
+
/** See {@link PeerConfig.keyFrameRequestRouting}. */
|
|
467
|
+
keyFrameRequestRouting?: KeyFrameRequestRouting | DeprecatedKeyFrameRequestRouting;
|
|
172
468
|
};
|
|
173
|
-
export declare function
|
|
469
|
+
export declare function peerConfigHasDtls13(config: PeerConfig): boolean;
|
|
470
|
+
export declare function generateDefaultPeerConfig(): Required<PeerConfig>;
|
|
174
471
|
export declare const defaultPeerConfig: PeerConfig;
|
|
175
472
|
export declare function clonePeerConfiguration(config: PeerConfig): {
|
|
176
473
|
codecs: {
|
|
@@ -189,8 +486,15 @@ export declare function clonePeerConfiguration(config: PeerConfig): {
|
|
|
189
486
|
icePortRange: [number, number] | undefined;
|
|
190
487
|
iceAdditionalHostAddresses: string[] | undefined;
|
|
191
488
|
dtls: {
|
|
489
|
+
protocolVersions: DtlsVersion[] | undefined;
|
|
490
|
+
helloRetryRequest: boolean | undefined;
|
|
192
491
|
keys?: DtlsKeys | undefined;
|
|
193
492
|
};
|
|
493
|
+
warp: {
|
|
494
|
+
allowEarlyServerData?: boolean;
|
|
495
|
+
earlyMediaPolicy?: "drop" | "buffer";
|
|
496
|
+
sendBeforeNomination?: boolean;
|
|
497
|
+
} | undefined;
|
|
194
498
|
certificates: RTCCertificate[];
|
|
195
499
|
debug: {
|
|
196
500
|
inboundPacketLoss?: number | undefined;
|
|
@@ -226,6 +530,22 @@ export declare function clonePeerConfiguration(config: PeerConfig): {
|
|
|
226
530
|
* VPN, ...). If the bind fails, the family has no UDP host candidate.
|
|
227
531
|
* A family left unspecified while the other one is set gathers no
|
|
228
532
|
* enumerated addresses (only its `iceAdditionalHostAddresses`).
|
|
533
|
+
*
|
|
534
|
+
* When unset, each enumerated interface address gets a UDP host socket
|
|
535
|
+
* bound to that address, so connectivity checks leave from the advertised
|
|
536
|
+
* candidate on multi-NIC hosts. An address whose bind fails is not
|
|
537
|
+
* advertised. VPN / tunnel interfaces (`tun`, `utun`, `ipsec`, `tap`) are
|
|
538
|
+
* gathered with a low priority and the default-route address with the
|
|
539
|
+
* highest: the source address of the route to the configured STUN / TURN
|
|
540
|
+
* server (without one, no address is preferred and nothing else is probed).
|
|
541
|
+
* With a STUN server, one more socket per family is bound to the
|
|
542
|
+
* wildcard address: it advertises no host candidate but maps the route the
|
|
543
|
+
* OS picks (server-reflexive candidate with `raddr 0.0.0.0`).
|
|
544
|
+
* `setLocalDescription()` waits only for that socket and the
|
|
545
|
+
* default-route one; the other interfaces' server-reflexive candidates
|
|
546
|
+
* trickle through `onicecandidate` before the end-of-candidates `null`.
|
|
547
|
+
* Set a family to `0.0.0.0` / `::` to gather its enumerated addresses over
|
|
548
|
+
* wildcard sockets instead.
|
|
229
549
|
*/
|
|
230
550
|
iceInterfaceAddresses: InterfaceAddresses | undefined;
|
|
231
551
|
iceUseIpv4: boolean;
|
|
@@ -235,7 +555,8 @@ export declare function clonePeerConfiguration(config: PeerConfig): {
|
|
|
235
555
|
iceTcpPassive: boolean;
|
|
236
556
|
/**
|
|
237
557
|
* Seconds to wait for server-reflexive candidates while gathering.
|
|
238
|
-
* Defaults to 5 when undefined.
|
|
558
|
+
* Defaults to 5 when undefined. `setLocalDescription()` waits for it only
|
|
559
|
+
* on the wildcard and default-route sockets (see `iceInterfaceAddresses`).
|
|
239
560
|
*/
|
|
240
561
|
iceStunGatherTimeout: number | undefined;
|
|
241
562
|
/**
|
|
@@ -243,6 +564,57 @@ export declare function clonePeerConfiguration(config: PeerConfig): {
|
|
|
243
564
|
* Defaults to 8 when undefined.
|
|
244
565
|
*/
|
|
245
566
|
iceTurnConnectTimeout: number | undefined;
|
|
567
|
+
/**
|
|
568
|
+
* Seconds ICE waits for a connectivity check from the peer when it has no
|
|
569
|
+
* candidate pair of its own to check after both sides ended their
|
|
570
|
+
* candidates (the peer offered only active TCP candidates, as Firefox does
|
|
571
|
+
* for ICE-TCP, or none werift can reach). Without a check in that time the
|
|
572
|
+
* ICE transport fails. With `iceLite`, which sends no checks, ICE waits the
|
|
573
|
+
* same time whenever it has no candidate pair, also while it still
|
|
574
|
+
* gathers. The deadline is fixed when the wait begins; once gathering ended
|
|
575
|
+
* without a socket that could receive a check, ICE fails at once. Defaults
|
|
576
|
+
* to 30 when undefined; 0 fails at once.
|
|
577
|
+
*/
|
|
578
|
+
iceIncomingCheckTimeout: number | undefined;
|
|
579
|
+
/**
|
|
580
|
+
* werift extension. With `iceNomination: "regular"`: milliseconds the
|
|
581
|
+
* controlling ICE agent keeps checking before it nominates a candidate pair,
|
|
582
|
+
* so a higher-priority candidate trickled shortly after a lower-priority one
|
|
583
|
+
* succeeded can still be selected. Maps to `IceOptions.nominationDelayMs`:
|
|
584
|
+
* 300 when undefined, 0 nominates the first valid pair at once.
|
|
585
|
+
*/
|
|
586
|
+
iceNominationDelayMs: number | undefined;
|
|
587
|
+
/**
|
|
588
|
+
* werift extension. How the controlling ICE agent nominates toward a full
|
|
589
|
+
* ICE peer (`IceOptions.nomination`). `"semi-aggressive"` (default when
|
|
590
|
+
* undefined, as Chrome): the first pair whose check succeeds is selected at
|
|
591
|
+
* once and a higher-priority pair that succeeds later replaces it.
|
|
592
|
+
* `"regular"`: RFC 8445 regular nomination, one nomination after
|
|
593
|
+
* `iceNominationDelayMs`.
|
|
594
|
+
*/
|
|
595
|
+
iceNomination: "semi-aggressive" | "regular" | undefined;
|
|
596
|
+
/**
|
|
597
|
+
* werift extension. Enable ICE renomination
|
|
598
|
+
* (draft-thatcher-ice-renomination, as libwebrtc implements it): every
|
|
599
|
+
* description advertises `a=ice-options:trickle renomination`. When the
|
|
600
|
+
* remote description advertises `renomination` too, the controlling agent
|
|
601
|
+
* nominates with the NOMINATION STUN attribute and an increasing value, so
|
|
602
|
+
* a later, better pair reliably replaces the selection on both sides
|
|
603
|
+
* (`IceOptions.renomination`). Chrome advertises it only when its SDP is
|
|
604
|
+
* modified before `setLocalDescription`; as the controlled side it honours
|
|
605
|
+
* the attribute regardless. Defaults to false.
|
|
606
|
+
*/
|
|
607
|
+
iceRenomination: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* werift extension. Thresholds of the failover of the selected candidate
|
|
610
|
+
* pair without an ICE restart (with semi-aggressive nomination or
|
|
611
|
+
* renomination): how soon a pair is unwritable (`unwritableMinChecks`,
|
|
612
|
+
* `unwritableTimeout`) and how soon a selected pair that stopped receiving
|
|
613
|
+
* moves to a backup (`receivingTimeout`, `receivingSwitchingDelay`). Maps
|
|
614
|
+
* to `IceOptions.failover`; each unset or invalid value keeps its default
|
|
615
|
+
* (libwebrtc's: 5 checks, 5000 ms, 2500 ms, 1000 ms).
|
|
616
|
+
*/
|
|
617
|
+
iceFailover: IceFailoverOptions | undefined;
|
|
246
618
|
turnTransport: "udp" | "tcp" | "tls" | undefined;
|
|
247
619
|
turnTlsOptions: TlsConnectionOptions | undefined;
|
|
248
620
|
/**
|
|
@@ -259,22 +631,76 @@ export declare function clonePeerConfiguration(config: PeerConfig): {
|
|
|
259
631
|
* Return `true` if a STUN response should be sent, false if it should be skipped. */
|
|
260
632
|
iceFilterStunResponse: ((message: Message, addr: Address, protocol: Protocol) => boolean) | undefined;
|
|
261
633
|
iceFilterCandidatePair: ((pair: CandidatePair) => boolean) | undefined;
|
|
634
|
+
/**
|
|
635
|
+
* Opt-in SPED (DTLS handshake embedded in ICE Binding).
|
|
636
|
+
* Omit or false: ICE completes, then DTLS starts (current serial path).
|
|
637
|
+
* true: this PeerConnection only overlaps ICE checks with DTLS 1.3 handshake.
|
|
638
|
+
* Requires explicit DTLS 1.3 in `dtls.protocolVersions`
|
|
639
|
+
* (`dtls.protocolVersions` defaults to empty / DTLS 1.2 only).
|
|
640
|
+
* Cannot be combined with `dtls.helloRetryRequest: true`
|
|
641
|
+
* (SPED uses ICE-authenticated address validation, not a DTLS cookie).
|
|
642
|
+
* Both are validated by the constructor and `setConfiguration()`, which
|
|
643
|
+
* throw synchronously and leave the configuration unchanged.
|
|
644
|
+
*/
|
|
645
|
+
sped?: boolean;
|
|
646
|
+
/**
|
|
647
|
+
* Integrity attributes of the ICE connectivity checks and consent requests
|
|
648
|
+
* werift sends (RFC 8489 short-term credentials). Applies to ICE transports
|
|
649
|
+
* created after it is set.
|
|
650
|
+
* - `undefined` / `"sha1"` (default): MESSAGE-INTEGRITY only. Browsers
|
|
651
|
+
* (libwebrtc, Firefox) accept this.
|
|
652
|
+
* - `"sha256"`: MESSAGE-INTEGRITY-SHA256 only. Only for peers known to
|
|
653
|
+
* support it: a peer that does not know the attribute rejects the checks.
|
|
654
|
+
* - `"both"`: MESSAGE-INTEGRITY followed by MESSAGE-INTEGRITY-SHA256.
|
|
655
|
+
*
|
|
656
|
+
* Checks and responses from the peer are accepted with either algorithm,
|
|
657
|
+
* and responses are always signed with the algorithm of the request.
|
|
658
|
+
*/
|
|
659
|
+
iceMessageIntegrity: MessageIntegrityMode | undefined;
|
|
660
|
+
/**
|
|
661
|
+
* Advertise the `ice2` ice-option (`a=ice-options:trickle ice2`, RFC 8445
|
|
662
|
+
* §10 / RFC 8839) to declare an RFC 8445 agent. Defaults to false
|
|
663
|
+
* (`a=ice-options:trickle`). It is only a declaration: werift runs the
|
|
664
|
+
* RFC 8445 procedures either way. Cannot be changed after construction.
|
|
665
|
+
*/
|
|
666
|
+
iceOptionIce2: boolean;
|
|
262
667
|
icePasswordPrefix: string | undefined;
|
|
263
668
|
bundlePolicy: BundlePolicy;
|
|
264
669
|
rtcpMuxPolicy: "require";
|
|
265
670
|
iceCandidatePoolSize: number;
|
|
266
671
|
/**
|
|
267
|
-
* Which default DTLS certificate is used when neither `certificates` nor `dtls.keys` is given
|
|
268
|
-
* Cannot be changed after construction.
|
|
269
|
-
* - `"process"` (default): one certificate shared by every RTCPeerConnection in the process
|
|
270
|
-
*
|
|
271
|
-
* - `"
|
|
672
|
+
* Which default DTLS certificate is used when neither `certificates` nor `dtls.keys` is given
|
|
673
|
+
* (see {@link CompatibilityOptionValues}). Cannot be changed after construction.
|
|
674
|
+
* - `"process"` (default): one certificate shared by every RTCPeerConnection in the process,
|
|
675
|
+
* so their `a=fingerprint` values are identical.
|
|
676
|
+
* - `"standard"`: each RTCPeerConnection generates its own certificate, as browsers do.
|
|
272
677
|
* All DTLS transports of that connection share it.
|
|
678
|
+
*
|
|
679
|
+
* Also accepts the v0.27.0 name `"peerConnection"` (= `"standard"`).
|
|
273
680
|
*/
|
|
274
681
|
certificateScope: CertificateScope;
|
|
275
682
|
midSuffix: boolean;
|
|
276
683
|
/** Advertised local SCTP max-message-size in SDP. Use 0 for unlimited. */
|
|
277
684
|
maxMessageSize: number;
|
|
685
|
+
/**
|
|
686
|
+
* The initial `binaryType` of every data channel this connection creates,
|
|
687
|
+
* by `createDataChannel()` or announced by the remote peer (a compatibility
|
|
688
|
+
* option, see {@link CompatibilityOptionValues} and
|
|
689
|
+
* {@link RTCDataChannelBinaryType}).
|
|
690
|
+
* - `"nodebuffer"` (default, werift's own value): binary messages arrive as
|
|
691
|
+
* a Node.js `Buffer`, as before this option existed.
|
|
692
|
+
* - `"standard"`: the browser default, `"arraybuffer"` (W3C); the channel's
|
|
693
|
+
* `binaryType` reads `"arraybuffer"`.
|
|
694
|
+
* - `"arraybuffer"` / `"blob"`: binary messages arrive as an `ArrayBuffer`
|
|
695
|
+
* / a `Blob` (`werift/polyfill` uses `"arraybuffer"`).
|
|
696
|
+
*
|
|
697
|
+
* Another value is a `TypeError`. `compatibility: "standard"` sets it to
|
|
698
|
+
* `"standard"` when it is not given. `setConfiguration()` may change it; the
|
|
699
|
+
* new value applies to channels created afterwards, and an existing
|
|
700
|
+
* channel changes with its own `binaryType` setter.
|
|
701
|
+
* @see tests/datachannel/binaryType.test.ts "dataChannelBinaryType: standard gives channels the W3C default arraybuffer"
|
|
702
|
+
*/
|
|
703
|
+
dataChannelBinaryType: DataChannelBinaryTypeOption;
|
|
278
704
|
/**
|
|
279
705
|
* When true, padding-only RTP is omitted from onReceiveRtp and later media
|
|
280
706
|
* sequence numbers are compacted. Default false preserves wire RTP events.
|
|
@@ -283,24 +709,109 @@ export declare function clonePeerConfiguration(config: PeerConfig): {
|
|
|
283
709
|
/** Send-side estimator used by each new sender; defaults to `"lightweight"`. */
|
|
284
710
|
bandwidthEstimator: BandwidthEstimatorOption;
|
|
285
711
|
/**
|
|
286
|
-
* How local SDP marks inactive / stopped m-lines
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
* and
|
|
290
|
-
*
|
|
712
|
+
* How local SDP marks inactive / stopped m-lines (see {@link CompatibilityOptionValues}).
|
|
713
|
+
* Cannot be changed after construction.
|
|
714
|
+
* - `"standard"` (default): an accepted `inactive` m-line keeps a non-zero port, as JSEP
|
|
715
|
+
* and browsers do. Only rejected (no common codec / remote port 0) or stopped m-lines
|
|
716
|
+
* use port 0, and only those negotiated port 0 positions are reused by new transceivers.
|
|
717
|
+
* - `"aggressive"`: behavior before v0.25.0. `inactive` m-lines are also written with
|
|
718
|
+
* port 0, so the remote side treats them as rejected and their positions are reused.
|
|
719
|
+
*
|
|
720
|
+
* Also accepts the v0.27.0 name `"compatible"` (= `"standard"`).
|
|
291
721
|
*/
|
|
292
722
|
mLineReuse: MLineReuse;
|
|
293
723
|
/**
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
724
|
+
* How a remote offer's m-sections are paired with local transceivers that
|
|
725
|
+
* have no MID yet (see {@link CompatibilityOptionValues}). Cannot be changed
|
|
726
|
+
* after construction.
|
|
727
|
+
* - `"byKind"` (default): behavior up to v0.27.0. Any unassociated,
|
|
728
|
+
* non-stopped transceiver of the same kind is paired (the one at the same
|
|
729
|
+
* m-line index first), whatever created it. In glare (perfect negotiation)
|
|
730
|
+
* the remote offer can take over a transceiver created with
|
|
731
|
+
* `addTransceiver(kind, { direction: "sendonly" })` and its direction
|
|
732
|
+
* becomes `sendrecv`.
|
|
733
|
+
* - `"standard"`: RFC 8829 (JSEP) section 5.10, as browsers do. An
|
|
734
|
+
* m-section whose MID no transceiver has is associated only with an
|
|
735
|
+
* unassociated, non-stopped transceiver of the same kind that
|
|
736
|
+
* `addTrack()` created (or one a rollback promoted to that, JSEP 4.1.8.2),
|
|
737
|
+
* and only when the m-section is `sendrecv` or `recvonly`. A transceiver
|
|
738
|
+
* created by `addTransceiver()` (with or without a track, also after
|
|
739
|
+
* `replaceTrack()` or a later `addTrack()` reusing it) is never paired:
|
|
740
|
+
* the offer gets a new transceiver, and the local one keeps its direction
|
|
741
|
+
* and `mid === null` until a local offer negotiates it. Use it for the
|
|
742
|
+
* perfect negotiation pattern and for code written for browsers.
|
|
743
|
+
*/
|
|
744
|
+
transceiverPairing: TransceiverPairing;
|
|
745
|
+
/**
|
|
746
|
+
* Where a PLI / FIR goes when no route has its target SSRC (see
|
|
747
|
+
* {@link CompatibilityOptionValues} and {@link KeyFrameRequestRouting}).
|
|
748
|
+
* `setConfiguration()` may change it.
|
|
749
|
+
* - `"fallback"` (default): the sender whose RTX SSRC it is, else the only video sender.
|
|
750
|
+
* - `"standard"`: not delivered, as RFC 4585 / RFC 5104 define the target.
|
|
751
|
+
*
|
|
752
|
+
* Also accepts the names up to v0.27.0: `"compatible"` (= `"fallback"`) and
|
|
753
|
+
* `"strict"` (= `"standard"`).
|
|
297
754
|
*/
|
|
298
755
|
keyFrameRequestRouting: KeyFrameRequestRouting;
|
|
756
|
+
/**
|
|
757
|
+
* How strictly the DTLS 1.2 handshake validates the peer's messages (see
|
|
758
|
+
* {@link CompatibilityOptionValues}). Cannot be changed after construction.
|
|
759
|
+
* - `"lenient"` (default): a malformed `supported_versions` is ignored and
|
|
760
|
+
* DTLS 1.2 negotiated, duplicate extensions are accepted and `use_srtp`
|
|
761
|
+
* is read without length checks, as before the strict checks.
|
|
762
|
+
* - `"standard"`: RFC-strict; these fail the handshake (a malformed
|
|
763
|
+
* `supported_versions` with a `protocol_version` alert).
|
|
764
|
+
*
|
|
765
|
+
* A `supported_versions` without an overlapping version fails either way,
|
|
766
|
+
* and DTLS 1.3 always validates strictly.
|
|
767
|
+
*/
|
|
768
|
+
dtlsHandshakeValidation: DtlsHandshakeValidation;
|
|
769
|
+
/**
|
|
770
|
+
* Which m-lines of a BUNDLE group carry the local ICE candidates.
|
|
771
|
+
* Cannot be changed after construction. See {@link BundleCandidates}.
|
|
772
|
+
* - `"legacy"` (default): every m-line repeats its transport's candidates and
|
|
773
|
+
* `a=end-of-candidates` (werift's earlier output).
|
|
774
|
+
* - `"compatible"`: as Chrome writes them, only the BUNDLE tag m-line carries
|
|
775
|
+
* them, so renegotiation with more m-lines no longer repeats the candidate list.
|
|
776
|
+
*/
|
|
777
|
+
bundleCandidates: BundleCandidates;
|
|
778
|
+
/**
|
|
779
|
+
* Sets every compatibility option (`certificateScope`, `mLineReuse`,
|
|
780
|
+
* `transceiverPairing`, `keyFrameRequestRouting`,
|
|
781
|
+
* `dtlsHandshakeValidation`, `dataChannelBinaryType`, see
|
|
782
|
+
* {@link CompatibilityOptionValues}) to the specification / browser behavior
|
|
783
|
+
* at once. Cannot be changed after construction.
|
|
784
|
+
* - `undefined` (default): each option keeps its own default.
|
|
785
|
+
* - `"standard"`: every compatibility option not given in the same
|
|
786
|
+
* configuration is `"standard"`.
|
|
787
|
+
*
|
|
788
|
+
* An option given explicitly always takes precedence over `compatibility`:
|
|
789
|
+
* a value given in the same configuration (an old name included) is kept,
|
|
790
|
+
* and `setConfiguration()` treats the options as if `compatibility` were
|
|
791
|
+
* not set (`keyFrameRequestRouting` and `dataChannelBinaryType` may
|
|
792
|
+
* change, the others cannot). An
|
|
793
|
+
* option given as `undefined` counts as not given.
|
|
794
|
+
*
|
|
795
|
+
* ```ts
|
|
796
|
+
* new RTCPeerConnection({ compatibility: "standard" });
|
|
797
|
+
* // certificateScope, mLineReuse, transceiverPairing,
|
|
798
|
+
* // keyFrameRequestRouting, dtlsHandshakeValidation and
|
|
799
|
+
* // dataChannelBinaryType are all "standard"
|
|
800
|
+
* new RTCPeerConnection({ compatibility: "standard", certificateScope: "process" });
|
|
801
|
+
* // certificateScope is "process", the others are "standard"
|
|
802
|
+
* ```
|
|
803
|
+
*
|
|
804
|
+
* It does not change `iceServers` / `iceUseDefaultStunServer`, which are not
|
|
805
|
+
* compatibility options.
|
|
806
|
+
* @see tests/datachannel/binaryType.test.ts "compatibility: standard makes data channels deliver ArrayBuffer unless dataChannelBinaryType is given"
|
|
807
|
+
*/
|
|
808
|
+
compatibility: CompatibilityPreset | undefined;
|
|
299
809
|
};
|
|
300
|
-
export declare function mergePeerConfiguration(config: PeerConfig, input: RTCPeerConnectionConfig, { isReconfiguration, hasLocalDescription, hasSctpTransport, }: {
|
|
810
|
+
export declare function mergePeerConfiguration(config: PeerConfig, input: RTCPeerConnectionConfig, { isReconfiguration, hasLocalDescription, hasSctpTransport, dtlsTransportCreated, }: {
|
|
301
811
|
isReconfiguration: boolean;
|
|
302
812
|
hasLocalDescription: boolean;
|
|
303
813
|
hasSctpTransport: boolean;
|
|
814
|
+
dtlsTransportCreated: boolean;
|
|
304
815
|
}): Partial<PeerConfig> & {
|
|
305
816
|
sctp?: RTCSctpConfiguration;
|
|
306
817
|
};
|