werift 0.28.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 +182 -2
- package/lib/common/src/transport.d.ts +39 -5
- package/lib/common/src/transport.js +32 -7
- package/lib/common/src/transport.js.map +1 -1
- 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 +1257 -16
- package/lib/dtls/src/client.js.map +1 -1
- package/lib/dtls/src/context/dtls.d.ts +45 -0
- package/lib/dtls/src/context/dtls.js +114 -0
- package/lib/dtls/src/context/dtls.js.map +1 -1
- package/lib/dtls/src/context/transport.d.ts +13 -0
- package/lib/dtls/src/context/transport.js +29 -1
- 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 +13 -1
- package/lib/dtls/src/flight/client/flight5.js.map +1 -1
- package/lib/dtls/src/flight/flight.d.ts +16 -0
- package/lib/dtls/src/flight/flight.js +109 -8
- 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 +8 -0
- 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 +6 -1
- package/lib/dtls/src/index.js +116 -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 +6 -0
- package/lib/dtls/src/record/const.js +6 -0
- 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.js +24 -16
- 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 +367 -20
- package/lib/dtls/src/server.js.map +1 -1
- package/lib/dtls/src/socket.d.ts +379 -35
- package/lib/dtls/src/socket.js +1105 -132
- 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/consent.d.ts +78 -1
- package/lib/ice/src/consent.js +236 -24
- package/lib/ice/src/consent.js.map +1 -1
- 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 +265 -9
- package/lib/ice/src/ice.js +1624 -236
- package/lib/ice/src/ice.js.map +1 -1
- package/lib/ice/src/iceBase.d.ts +197 -6
- package/lib/ice/src/iceBase.js +157 -7
- package/lib/ice/src/iceBase.js.map +1 -1
- package/lib/ice/src/index.d.ts +2 -0
- package/lib/ice/src/index.js +4 -1
- package/lib/ice/src/index.js.map +1 -1
- 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/hostInterfaces.d.ts +13 -2
- package/lib/ice/src/internal/hostInterfaces.js +16 -4
- package/lib/ice/src/internal/hostInterfaces.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/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 +40 -0
- package/lib/ice/src/nomination/selectionReplacement.js +65 -7
- package/lib/ice/src/nomination/selectionReplacement.js.map +1 -1
- 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 +29 -0
- package/lib/ice/src/stun/protocol.js +91 -4
- 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 +1 -0
- package/lib/ice/src/stun/tcpProtocol.js +14 -2
- 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 +23 -0
- package/lib/ice/src/stun/transaction.js.map +1 -1
- package/lib/ice/src/turn/protocol.d.ts +21 -2
- package/lib/ice/src/turn/protocol.js +93 -8
- package/lib/ice/src/turn/protocol.js.map +1 -1
- package/lib/ice/src/types/model.d.ts +9 -0
- 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/message.d.ts +15 -2
- package/lib/ice-server/src/stun/message.js +156 -25
- 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 +19568 -3106
- package/lib/nonstandard/index.mjs +2539 -1175
- package/lib/polyfill/dom.mjs +33210 -16872
- package/lib/polyfill/index.mjs +33345 -17013
- 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/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 +81 -5
- package/lib/sctp/src/sctp.js +273 -28
- package/lib/sctp/src/sctp.js.map +1 -1
- package/lib/webrtc/src/api/compatibilityOptions.d.ts +11 -1
- package/lib/webrtc/src/api/compatibilityOptions.js +11 -1
- package/lib/webrtc/src/api/compatibilityOptions.js.map +1 -1
- package/lib/webrtc/src/api/peerConfig.d.ts +210 -13
- package/lib/webrtc/src/api/peerConfig.js +100 -5
- package/lib/webrtc/src/api/peerConfig.js.map +1 -1
- package/lib/webrtc/src/api/peerConnectionEvents.d.ts +10 -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/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/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 +6 -0
- package/lib/webrtc/src/media/router.js +39 -1
- package/lib/webrtc/src/media/router.js.map +1 -1
- package/lib/webrtc/src/media/rtpReceiver.d.ts +56 -6
- package/lib/webrtc/src/media/rtpReceiver.js +165 -15
- package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
- package/lib/webrtc/src/media/rtpSender.d.ts +1 -1
- package/lib/webrtc/src/media/rtpSender.js +4 -3
- package/lib/webrtc/src/media/rtpSender.js.map +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.d.ts +29 -11
- package/lib/webrtc/src/media/rtpTransceiver.js +31 -9
- package/lib/webrtc/src/media/rtpTransceiver.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 +103 -11
- package/lib/webrtc/src/media/track.js +241 -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/transportActivation.d.ts +4 -0
- package/lib/webrtc/src/negotiation/transportActivation.js +112 -11
- package/lib/webrtc/src/negotiation/transportActivation.js.map +1 -1
- package/lib/webrtc/src/negotiationTransaction.d.ts +25 -4
- package/lib/webrtc/src/negotiationTransaction.js +27 -6
- 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 +44 -8
- package/lib/webrtc/src/peerConnection.js +88 -9
- 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 +6 -2
- 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 +2 -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 +158 -38
- package/lib/webrtc/src/sctpManager.js.map +1 -1
- package/lib/webrtc/src/sdp.d.ts +38 -2
- package/lib/webrtc/src/sdp.js +84 -3
- package/lib/webrtc/src/sdp.js.map +1 -1
- package/lib/webrtc/src/sdpManager.d.ts +19 -9
- package/lib/webrtc/src/sdpManager.js +26 -4
- package/lib/webrtc/src/sdpManager.js.map +1 -1
- package/lib/webrtc/src/secureTransportManager.d.ts +11 -2
- package/lib/webrtc/src/secureTransportManager.js +84 -5
- package/lib/webrtc/src/secureTransportManager.js.map +1 -1
- package/lib/webrtc/src/transceiverManager.d.ts +5 -2
- package/lib/webrtc/src/transceiverManager.js +42 -14
- 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 +150 -55
- package/lib/webrtc/src/transport/dtls.js +1017 -556
- package/lib/webrtc/src/transport/dtls.js.map +1 -1
- package/lib/webrtc/src/transport/ice.d.ts +35 -2
- package/lib/webrtc/src/transport/ice.js +147 -14
- 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 +126 -2
- package/lib/webrtc/src/transport/sctp.js +747 -134
- 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 +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 +7 -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
package/lib/ice/src/iceBase.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Candidate } from "./candidate";
|
|
2
2
|
import { type IceCandidateErrorInfo, type IceServerReachedInfo } from "./candidateError";
|
|
3
3
|
import type { MdnsLookup } from "./dns/lookup";
|
|
4
|
+
import type { IceGatheringErrorInfo } from "./gatheringError";
|
|
4
5
|
import type { Cancelable } from "./helper";
|
|
5
6
|
import { type Address, type Event, type InterfaceAddresses, type TlsConnectionOptions } from "./imports/common";
|
|
6
7
|
import { type MessageIntegrityMode } from "./stun/const";
|
|
@@ -73,6 +74,12 @@ export interface IceConnection {
|
|
|
73
74
|
* (see {@link IceServerReachedInfo}). Optional like onIceCandidateError.
|
|
74
75
|
*/
|
|
75
76
|
readonly onIceServerReached?: Event<[IceServerReachedInfo]>;
|
|
77
|
+
/**
|
|
78
|
+
* The current generation's gathering reported an error (see
|
|
79
|
+
* {@link IceGatheringErrorInfo}). Optional like onIceCandidateError.
|
|
80
|
+
* @see packages/webrtc/tests/transport/iceGatheringError.test.ts「of an ICE agent without onGatheringError: gathering-failed is reported and the gathering completes」
|
|
81
|
+
*/
|
|
82
|
+
readonly onGatheringError?: Event<[IceGatheringErrorInfo]>;
|
|
76
83
|
restart(): void;
|
|
77
84
|
/** Record the remote `a=ice-options` tokens (see remoteIceOptions). */
|
|
78
85
|
setRemoteIceOptions?(options: string[]): void;
|
|
@@ -178,6 +185,25 @@ export declare class CandidatePair implements CandidatePairStats {
|
|
|
178
185
|
retransmissionsSent: number;
|
|
179
186
|
consentRequestsSent: number;
|
|
180
187
|
private readonly requestTransactionIds;
|
|
188
|
+
/** The most recent RTT samples (seconds), oldest first (see `smoothedRtt`). */
|
|
189
|
+
private readonly rttSamples;
|
|
190
|
+
/**
|
|
191
|
+
* Record the RTT (seconds) of an answered check: the totals, the samples of
|
|
192
|
+
* {@link smoothedRtt} and, unless `latest` is false (a response to an older
|
|
193
|
+
* check than the one `rtt` came from), `rtt`.
|
|
194
|
+
* @see tests/ice/selection-controller.test.ts "a response to an older check (latest: false) counts for the totals and the smoothed RTT, not the current RTT"
|
|
195
|
+
*/
|
|
196
|
+
recordRoundTrip(rtt: number, { latest }?: {
|
|
197
|
+
latest?: boolean;
|
|
198
|
+
}): void;
|
|
199
|
+
/**
|
|
200
|
+
* The smoothed RTT (seconds) the selection switches by: the median of the
|
|
201
|
+
* last {@link RTT_SMOOTHING_SAMPLES} samples, undefined with fewer than
|
|
202
|
+
* {@link RTT_SMOOTHING_MIN_SAMPLES}.
|
|
203
|
+
* @see tests/ice/selection-controller.test.ts "the median of the last 5 samples: one outlier does not move it"
|
|
204
|
+
* @see tests/ice/selection-controller.test.ts "equal priority: one outlier RTT of the other pair does not move the selection"
|
|
205
|
+
*/
|
|
206
|
+
get smoothedRtt(): number | undefined;
|
|
181
207
|
toJSON(): {
|
|
182
208
|
protocol: string;
|
|
183
209
|
localCandidate: string;
|
|
@@ -197,6 +223,8 @@ export declare class CandidatePair implements CandidatePairStats {
|
|
|
197
223
|
get foundation(): string;
|
|
198
224
|
noteIncomingRequest(transactionId: string): boolean;
|
|
199
225
|
}
|
|
226
|
+
/** Default of {@link IceOptions.incomingCheckTimeout}, in seconds. */
|
|
227
|
+
export declare const DEFAULT_INCOMING_CHECK_TIMEOUT = 30;
|
|
200
228
|
export declare const ICE_COMPLETED: 1;
|
|
201
229
|
export declare const ICE_FAILED: 2;
|
|
202
230
|
/** Basic consent check period in seconds (RFC 7675). Actual interval is 0.8–1.2× this. */
|
|
@@ -209,17 +237,123 @@ export declare const CONSENT_FAILURES = 6;
|
|
|
209
237
|
/** RFC 7675: consent expires this many seconds after the last valid response. */
|
|
210
238
|
export declare const CONSENT_TIMEOUT = 30;
|
|
211
239
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
* answer in 150–300ms
|
|
240
|
+
* RTT-based response deadline of a consent request (ms) when the RTT is
|
|
241
|
+
* unknown (see {@link consentResponseTimeoutMs}). Downstream ICE-lite peers
|
|
242
|
+
* typically answer in 150–300ms. It is no longer how long the request's
|
|
243
|
+
* transaction stays open: that is {@link CONSENT_TIMEOUT}, so a response
|
|
244
|
+
* after this deadline still refreshes the consent.
|
|
215
245
|
*/
|
|
216
246
|
export declare const CONSENT_RESPONSE_TIMEOUT = 1000;
|
|
217
247
|
/** RFC 8445 §14.3: ICE RTO must not be less than 500ms. */
|
|
218
248
|
export declare const CONSENT_RESPONSE_TIMEOUT_MIN = 500;
|
|
219
249
|
/**
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
250
|
+
* Ping interval (ms) of a pair that is weak (a check went unanswered) or
|
|
251
|
+
* stabilizing (fewer than {@link MIN_PINGS_AT_WEAK_PING_INTERVAL} responses
|
|
252
|
+
* since it began to be monitored). libwebrtc:
|
|
253
|
+
* `WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL`.
|
|
254
|
+
*/
|
|
255
|
+
export declare const WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL = 900;
|
|
256
|
+
/**
|
|
257
|
+
* Ping interval (ms) of a stable backup pair (multiplied by a random 0.8–1.2).
|
|
258
|
+
* libwebrtc: `STABLE_WRITABLE_CONNECTION_PING_INTERVAL`.
|
|
259
|
+
*/
|
|
260
|
+
export declare const STABLE_WRITABLE_CONNECTION_PING_INTERVAL = 2500;
|
|
261
|
+
/**
|
|
262
|
+
* Responses a pair needs, pinged at the weak interval, before it counts as
|
|
263
|
+
* stable. libwebrtc: `MIN_PINGS_AT_WEAK_PING_INTERVAL`.
|
|
264
|
+
*/
|
|
265
|
+
export declare const MIN_PINGS_AT_WEAK_PING_INTERVAL = 3;
|
|
266
|
+
/**
|
|
267
|
+
* A pair is no longer writable once at least this many consecutive checks
|
|
268
|
+
* went unanswered and {@link CONNECTION_WRITE_CONNECT_TIMEOUT} passed since
|
|
269
|
+
* its last response. libwebrtc: `CONNECTION_WRITE_CONNECT_FAILURES`.
|
|
270
|
+
*/
|
|
271
|
+
export declare const CONNECTION_WRITE_CONNECT_FAILURES = 5;
|
|
272
|
+
/** See {@link CONNECTION_WRITE_CONNECT_FAILURES} (ms). libwebrtc: `CONNECTION_WRITE_CONNECT_TIMEOUT`. */
|
|
273
|
+
export declare const CONNECTION_WRITE_CONNECT_TIMEOUT = 5000;
|
|
274
|
+
/**
|
|
275
|
+
* A pair that received nothing (response, request or data) for this long
|
|
276
|
+
* (ms) is weak. libwebrtc: `WEAK_CONNECTION_RECEIVE_TIMEOUT`.
|
|
277
|
+
*/
|
|
278
|
+
export declare const WEAK_CONNECTION_RECEIVE_TIMEOUT = 2500;
|
|
279
|
+
/**
|
|
280
|
+
* How long (ms) the selected pair must have stopped receiving (nothing
|
|
281
|
+
* received for {@link WEAK_CONNECTION_RECEIVE_TIMEOUT}) before the
|
|
282
|
+
* controlling agent fails over to a backup that receives, without waiting
|
|
283
|
+
* for the selected pair to become unwritable. libwebrtc:
|
|
284
|
+
* `receiving_switching_delay` (default 1000 ms).
|
|
285
|
+
*/
|
|
286
|
+
export declare const RECEIVING_SWITCHING_DELAY = 1000;
|
|
287
|
+
/**
|
|
288
|
+
* A backup pair that received nothing for this long (ms) is dropped (its
|
|
289
|
+
* state becomes Failed) and the next pair of its socket is monitored. The
|
|
290
|
+
* same value as {@link CONSENT_TIMEOUT}. libwebrtc:
|
|
291
|
+
* `DEAD_CONNECTION_RECEIVE_TIMEOUT`.
|
|
292
|
+
*/
|
|
293
|
+
export declare const DEAD_CONNECTION_RECEIVE_TIMEOUT: number;
|
|
294
|
+
/**
|
|
295
|
+
* Response timeout (ms) of a backup check while the pair's RTT is still
|
|
296
|
+
* unknown (it never answered a check of this agent). libwebrtc starts a
|
|
297
|
+
* connection's RTT estimate at `DEFAULT_RTT` (3000 ms); the consent default
|
|
298
|
+
* ({@link CONSENT_RESPONSE_TIMEOUT}, 1 s) would never let a backup path
|
|
299
|
+
* slower than that become valid. Once the pair answered, the timeout follows
|
|
300
|
+
* its RTT ({@link consentResponseTimeoutMs}).
|
|
301
|
+
*/
|
|
302
|
+
export declare const BACKUP_UNKNOWN_RTT_RESPONSE_TIMEOUT = 3000;
|
|
303
|
+
/**
|
|
304
|
+
* After the selected pair's consent expired (RFC 7675: no more application
|
|
305
|
+
* data on it), how long (ms) the agent stays `disconnected` waiting for the
|
|
306
|
+
* selection to move to a writable backup (its own failover nomination, or
|
|
307
|
+
* the peer's when controlled) before it fails. A peer that fails over does
|
|
308
|
+
* so 5–10 s after the path broke, long before the 30 s expiry; the grace
|
|
309
|
+
* covers a nomination still in flight. werift's own value.
|
|
310
|
+
*/
|
|
311
|
+
export declare const FAILOVER_CONSENT_EXPIRED_GRACE = 10000;
|
|
312
|
+
/**
|
|
313
|
+
* Pairs of one local socket (or TURN allocation) tried as its backup before
|
|
314
|
+
* the socket waits for a retry (1, 2, 4, 8, 16 s, then every 16 s) and starts
|
|
315
|
+
* again from its highest-priority pair. werift's own limit.
|
|
316
|
+
*/
|
|
317
|
+
export declare const FAILOVER_BACKUP_ATTEMPTS = 3;
|
|
318
|
+
/**
|
|
319
|
+
* Consecutive responses a pair the agent failed over from needs before the
|
|
320
|
+
* selection may move back to it (or to another pair of its socket). Keeps
|
|
321
|
+
* the selection from flapping. werift's own value (libwebrtc relies on
|
|
322
|
+
* {@link MIN_PINGS_AT_WEAK_PING_INTERVAL} for the same purpose).
|
|
323
|
+
*/
|
|
324
|
+
export declare const FAILOVER_RECOVERY_RESPONSES = 3;
|
|
325
|
+
/**
|
|
326
|
+
* Between pairs of equal state and priority, the selection moves only to a
|
|
327
|
+
* pair whose smoothed RTT ({@link CandidatePair.smoothedRtt}) is at least this
|
|
328
|
+
* much (ms) lower. libwebrtc: `kMinImprovement`.
|
|
329
|
+
* @see tests/ice/selection-controller.test.ts "equal priority: a pair only 9 ms faster does not take the selection"
|
|
330
|
+
*/
|
|
331
|
+
export declare const RTT_SWITCH_MIN_IMPROVEMENT = 10;
|
|
332
|
+
/**
|
|
333
|
+
* The RTT samples {@link CandidatePair.smoothedRtt} keeps (the most recent
|
|
334
|
+
* ones). werift's own value: libwebrtc keeps a moving average instead, which
|
|
335
|
+
* one outlier still moves.
|
|
336
|
+
* @see tests/ice/selection-controller.test.ts "the median of the last 5 samples: one outlier does not move it"
|
|
337
|
+
*/
|
|
338
|
+
export declare const RTT_SMOOTHING_SAMPLES = 5;
|
|
339
|
+
/**
|
|
340
|
+
* Samples a pair needs before {@link CandidatePair.smoothedRtt} has a value
|
|
341
|
+
* (the RTT takes part in a switch). The same as
|
|
342
|
+
* {@link MIN_PINGS_AT_WEAK_PING_INTERVAL}: a backup is stable from then on.
|
|
343
|
+
* @see tests/ice/selection-controller.test.ts "the median of the last 5 samples: one outlier does not move it"
|
|
344
|
+
*/
|
|
345
|
+
export declare const RTT_SMOOTHING_MIN_SAMPLES = 3;
|
|
346
|
+
/**
|
|
347
|
+
* RTT-based response deadline (ms) from a pair RTT (seconds): when a consent
|
|
348
|
+
* request without a response counts as unanswered (failover's pacing and
|
|
349
|
+
* writability), and the response timeout of a backup check once the backup's
|
|
350
|
+
* RTT is known. Uses 2×RTT + 200ms jitter margin, floored at
|
|
351
|
+
* {@link CONSENT_RESPONSE_TIMEOUT_MIN}. Falls back to
|
|
352
|
+
* {@link CONSENT_RESPONSE_TIMEOUT} when RTT is unavailable.
|
|
353
|
+
*
|
|
354
|
+
* A consent request's transaction is not ended at this deadline: it stays
|
|
355
|
+
* open for {@link CONSENT_TIMEOUT}, so a response slower than the estimate
|
|
356
|
+
* (an RTT that rose after the selection) still refreshes the consent.
|
|
223
357
|
*/
|
|
224
358
|
export declare function consentResponseTimeoutMs(rttSeconds?: number): number;
|
|
225
359
|
/**
|
|
@@ -262,6 +396,43 @@ export type StunServerUrl = {
|
|
|
262
396
|
address: Address;
|
|
263
397
|
url: string;
|
|
264
398
|
};
|
|
399
|
+
/**
|
|
400
|
+
* Thresholds of the failover of the selected pair ({@link IceOptions.failover}),
|
|
401
|
+
* after libwebrtc's `RTCConfiguration` fields of the same meaning. Lower
|
|
402
|
+
* values fail over sooner and also on a shorter loss burst.
|
|
403
|
+
*/
|
|
404
|
+
export interface IceFailoverOptions {
|
|
405
|
+
/**
|
|
406
|
+
* Consecutive unanswered checks after which a pair is unwritable (together
|
|
407
|
+
* with `unwritableTimeout`). An integer of at least 1; defaults to
|
|
408
|
+
* {@link CONNECTION_WRITE_CONNECT_FAILURES} (5). libwebrtc:
|
|
409
|
+
* `ice_unwritable_min_checks`.
|
|
410
|
+
*/
|
|
411
|
+
unwritableMinChecks?: number;
|
|
412
|
+
/**
|
|
413
|
+
* Time (ms) since a pair's last response after which it is unwritable
|
|
414
|
+
* (together with `unwritableMinChecks`). At least 0; defaults to
|
|
415
|
+
* {@link CONNECTION_WRITE_CONNECT_TIMEOUT} (5000). libwebrtc:
|
|
416
|
+
* `ice_unwritable_timeout`.
|
|
417
|
+
*/
|
|
418
|
+
unwritableTimeout?: number;
|
|
419
|
+
/**
|
|
420
|
+
* Time (ms) without receiving anything (response, request or data) after
|
|
421
|
+
* which a pair is weak (checked at the weak interval, 900 ms) and stops
|
|
422
|
+
* receiving. Greater than 0; defaults to
|
|
423
|
+
* {@link WEAK_CONNECTION_RECEIVE_TIMEOUT} (2500). libwebrtc:
|
|
424
|
+
* `receiving_timeout`.
|
|
425
|
+
*/
|
|
426
|
+
receivingTimeout?: number;
|
|
427
|
+
/**
|
|
428
|
+
* Time (ms) the selected pair must have stopped receiving (one of its
|
|
429
|
+
* checks unanswered as well) before the controlling agent fails over to a
|
|
430
|
+
* backup that receives, before the selected pair becomes unwritable. At
|
|
431
|
+
* least 0; defaults to {@link RECEIVING_SWITCHING_DELAY} (1000).
|
|
432
|
+
* libwebrtc: `receiving_switching_delay`.
|
|
433
|
+
*/
|
|
434
|
+
receivingSwitchingDelay?: number;
|
|
435
|
+
}
|
|
265
436
|
export interface IceOptions {
|
|
266
437
|
/** Advertise and operate as an ICE lite agent. */
|
|
267
438
|
iceLite: boolean;
|
|
@@ -284,6 +455,19 @@ export interface IceOptions {
|
|
|
284
455
|
* timeout in the background and end-of-candidates follows them.
|
|
285
456
|
*/
|
|
286
457
|
stunGatherTimeout?: number;
|
|
458
|
+
/**
|
|
459
|
+
* Seconds `connect()` waits for a connectivity check from the peer when it
|
|
460
|
+
* has no candidate pair of its own to check after both sides ended their
|
|
461
|
+
* candidates: the peer offered only active TCP candidates (RFC 6544), or
|
|
462
|
+
* none this agent can reach. A check from the peer adds a peer-reflexive
|
|
463
|
+
* pair and the connection proceeds; without one, `connect()` fails when the
|
|
464
|
+
* time runs out. An ICE-lite agent, which sends no checks, waits the same
|
|
465
|
+
* time whenever it has no candidate pair, also while it still gathers. The
|
|
466
|
+
* deadline is fixed when the wait begins; once the local gathering ended
|
|
467
|
+
* without a socket that could receive a check, `connect()` fails at once.
|
|
468
|
+
* Defaults to 30; 0 fails at once.
|
|
469
|
+
*/
|
|
470
|
+
incomingCheckTimeout?: number;
|
|
287
471
|
/**
|
|
288
472
|
* Seconds to wait for a TURN TCP/TLS connection to be established.
|
|
289
473
|
* Defaults to 8.
|
|
@@ -333,6 +517,13 @@ export interface IceOptions {
|
|
|
333
517
|
* the pair with the largest value. Defaults to false.
|
|
334
518
|
*/
|
|
335
519
|
renomination?: boolean;
|
|
520
|
+
/**
|
|
521
|
+
* Thresholds of the failover of the selected pair without an ICE restart
|
|
522
|
+
* (semi-aggressive nomination or renomination, full ICE, not ICE-TCP).
|
|
523
|
+
* Each unset or invalid value keeps its default, which follows libwebrtc.
|
|
524
|
+
* See {@link IceFailoverOptions}.
|
|
525
|
+
*/
|
|
526
|
+
failover?: IceFailoverOptions;
|
|
336
527
|
/**
|
|
337
528
|
* STUN servers queried while gathering, in priority order. Every IPv4 UDP
|
|
338
529
|
* host socket queries each of them in parallel; equal mappings are
|
package/lib/ice/src/iceBase.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultOptions = exports.CandidatePairState = exports.CONSENT_RESPONSE_TIMEOUT_MIN = exports.CONSENT_RESPONSE_TIMEOUT = exports.CONSENT_TIMEOUT = exports.CONSENT_FAILURES = exports.CONSENT_INTERVAL = exports.ICE_FAILED = exports.ICE_COMPLETED = exports.CandidatePair = void 0;
|
|
3
|
+
exports.defaultOptions = exports.CandidatePairState = exports.RTT_SMOOTHING_MIN_SAMPLES = exports.RTT_SMOOTHING_SAMPLES = exports.RTT_SWITCH_MIN_IMPROVEMENT = exports.FAILOVER_RECOVERY_RESPONSES = exports.FAILOVER_BACKUP_ATTEMPTS = exports.FAILOVER_CONSENT_EXPIRED_GRACE = exports.BACKUP_UNKNOWN_RTT_RESPONSE_TIMEOUT = exports.DEAD_CONNECTION_RECEIVE_TIMEOUT = exports.RECEIVING_SWITCHING_DELAY = exports.WEAK_CONNECTION_RECEIVE_TIMEOUT = exports.CONNECTION_WRITE_CONNECT_TIMEOUT = exports.CONNECTION_WRITE_CONNECT_FAILURES = exports.MIN_PINGS_AT_WEAK_PING_INTERVAL = exports.STABLE_WRITABLE_CONNECTION_PING_INTERVAL = exports.WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL = exports.CONSENT_RESPONSE_TIMEOUT_MIN = exports.CONSENT_RESPONSE_TIMEOUT = exports.CONSENT_TIMEOUT = exports.CONSENT_FAILURES = exports.CONSENT_INTERVAL = exports.ICE_FAILED = exports.ICE_COMPLETED = exports.DEFAULT_INCOMING_CHECK_TIMEOUT = exports.CandidatePair = void 0;
|
|
4
4
|
exports.consentResponseTimeoutMs = consentResponseTimeoutMs;
|
|
5
5
|
exports.validateRemoteCandidate = validateRemoteCandidate;
|
|
6
6
|
exports.sortCandidatePairs = sortCandidatePairs;
|
|
@@ -25,6 +25,37 @@ class CandidatePair {
|
|
|
25
25
|
get state() {
|
|
26
26
|
return this._state;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Record the RTT (seconds) of an answered check: the totals, the samples of
|
|
30
|
+
* {@link smoothedRtt} and, unless `latest` is false (a response to an older
|
|
31
|
+
* check than the one `rtt` came from), `rtt`.
|
|
32
|
+
* @see tests/ice/selection-controller.test.ts "a response to an older check (latest: false) counts for the totals and the smoothed RTT, not the current RTT"
|
|
33
|
+
*/
|
|
34
|
+
recordRoundTrip(rtt, { latest = true } = {}) {
|
|
35
|
+
if (latest)
|
|
36
|
+
this.rtt = rtt;
|
|
37
|
+
this.totalRoundTripTime += rtt;
|
|
38
|
+
this.roundTripTimeMeasurements++;
|
|
39
|
+
this.rttSamples.push(rtt);
|
|
40
|
+
if (this.rttSamples.length > exports.RTT_SMOOTHING_SAMPLES)
|
|
41
|
+
this.rttSamples.shift();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The smoothed RTT (seconds) the selection switches by: the median of the
|
|
45
|
+
* last {@link RTT_SMOOTHING_SAMPLES} samples, undefined with fewer than
|
|
46
|
+
* {@link RTT_SMOOTHING_MIN_SAMPLES}.
|
|
47
|
+
* @see tests/ice/selection-controller.test.ts "the median of the last 5 samples: one outlier does not move it"
|
|
48
|
+
* @see tests/ice/selection-controller.test.ts "equal priority: one outlier RTT of the other pair does not move the selection"
|
|
49
|
+
*/
|
|
50
|
+
get smoothedRtt() {
|
|
51
|
+
if (this.rttSamples.length < exports.RTT_SMOOTHING_MIN_SAMPLES)
|
|
52
|
+
return undefined;
|
|
53
|
+
const sorted = [...this.rttSamples].sort((a, b) => a - b);
|
|
54
|
+
const middle = sorted.length >> 1;
|
|
55
|
+
return sorted.length % 2
|
|
56
|
+
? sorted[middle]
|
|
57
|
+
: (sorted[middle - 1] + sorted[middle]) / 2;
|
|
58
|
+
}
|
|
28
59
|
toJSON() {
|
|
29
60
|
return this.json;
|
|
30
61
|
}
|
|
@@ -198,6 +229,13 @@ class CandidatePair {
|
|
|
198
229
|
writable: true,
|
|
199
230
|
value: new Set()
|
|
200
231
|
});
|
|
232
|
+
/** The most recent RTT samples (seconds), oldest first (see `smoothedRtt`). */
|
|
233
|
+
Object.defineProperty(this, "rttSamples", {
|
|
234
|
+
enumerable: true,
|
|
235
|
+
configurable: true,
|
|
236
|
+
writable: true,
|
|
237
|
+
value: []
|
|
238
|
+
});
|
|
201
239
|
this.protocol = protocol;
|
|
202
240
|
this.remoteCandidate = remoteCandidate;
|
|
203
241
|
this.iceControlling = iceControlling;
|
|
@@ -234,6 +272,8 @@ class CandidatePair {
|
|
|
234
272
|
}
|
|
235
273
|
}
|
|
236
274
|
exports.CandidatePair = CandidatePair;
|
|
275
|
+
/** Default of {@link IceOptions.incomingCheckTimeout}, in seconds. */
|
|
276
|
+
exports.DEFAULT_INCOMING_CHECK_TIMEOUT = 30;
|
|
237
277
|
exports.ICE_COMPLETED = 1;
|
|
238
278
|
exports.ICE_FAILED = 2;
|
|
239
279
|
/** Basic consent check period in seconds (RFC 7675). Actual interval is 0.8–1.2× this. */
|
|
@@ -246,17 +286,127 @@ exports.CONSENT_FAILURES = 6;
|
|
|
246
286
|
/** RFC 7675: consent expires this many seconds after the last valid response. */
|
|
247
287
|
exports.CONSENT_TIMEOUT = 30;
|
|
248
288
|
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
* answer in 150–300ms
|
|
289
|
+
* RTT-based response deadline of a consent request (ms) when the RTT is
|
|
290
|
+
* unknown (see {@link consentResponseTimeoutMs}). Downstream ICE-lite peers
|
|
291
|
+
* typically answer in 150–300ms. It is no longer how long the request's
|
|
292
|
+
* transaction stays open: that is {@link CONSENT_TIMEOUT}, so a response
|
|
293
|
+
* after this deadline still refreshes the consent.
|
|
252
294
|
*/
|
|
253
295
|
exports.CONSENT_RESPONSE_TIMEOUT = 1000;
|
|
254
296
|
/** RFC 8445 §14.3: ICE RTO must not be less than 500ms. */
|
|
255
297
|
exports.CONSENT_RESPONSE_TIMEOUT_MIN = 500;
|
|
298
|
+
// Failover of the selected pair without an ICE restart (semi-aggressive
|
|
299
|
+
// nomination and renomination, full ICE, not ICE-TCP). The values follow
|
|
300
|
+
// libwebrtc (`p2p/base/connection.h`, `p2p/base/ice_controller_interface.h`,
|
|
301
|
+
// `basic_ice_controller.cc`); the libwebrtc name is given where it differs.
|
|
302
|
+
/**
|
|
303
|
+
* Ping interval (ms) of a pair that is weak (a check went unanswered) or
|
|
304
|
+
* stabilizing (fewer than {@link MIN_PINGS_AT_WEAK_PING_INTERVAL} responses
|
|
305
|
+
* since it began to be monitored). libwebrtc:
|
|
306
|
+
* `WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL`.
|
|
307
|
+
*/
|
|
308
|
+
exports.WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL = 900;
|
|
309
|
+
/**
|
|
310
|
+
* Ping interval (ms) of a stable backup pair (multiplied by a random 0.8–1.2).
|
|
311
|
+
* libwebrtc: `STABLE_WRITABLE_CONNECTION_PING_INTERVAL`.
|
|
312
|
+
*/
|
|
313
|
+
exports.STABLE_WRITABLE_CONNECTION_PING_INTERVAL = 2500;
|
|
314
|
+
/**
|
|
315
|
+
* Responses a pair needs, pinged at the weak interval, before it counts as
|
|
316
|
+
* stable. libwebrtc: `MIN_PINGS_AT_WEAK_PING_INTERVAL`.
|
|
317
|
+
*/
|
|
318
|
+
exports.MIN_PINGS_AT_WEAK_PING_INTERVAL = 3;
|
|
319
|
+
/**
|
|
320
|
+
* A pair is no longer writable once at least this many consecutive checks
|
|
321
|
+
* went unanswered and {@link CONNECTION_WRITE_CONNECT_TIMEOUT} passed since
|
|
322
|
+
* its last response. libwebrtc: `CONNECTION_WRITE_CONNECT_FAILURES`.
|
|
323
|
+
*/
|
|
324
|
+
exports.CONNECTION_WRITE_CONNECT_FAILURES = 5;
|
|
325
|
+
/** See {@link CONNECTION_WRITE_CONNECT_FAILURES} (ms). libwebrtc: `CONNECTION_WRITE_CONNECT_TIMEOUT`. */
|
|
326
|
+
exports.CONNECTION_WRITE_CONNECT_TIMEOUT = 5000;
|
|
327
|
+
/**
|
|
328
|
+
* A pair that received nothing (response, request or data) for this long
|
|
329
|
+
* (ms) is weak. libwebrtc: `WEAK_CONNECTION_RECEIVE_TIMEOUT`.
|
|
330
|
+
*/
|
|
331
|
+
exports.WEAK_CONNECTION_RECEIVE_TIMEOUT = 2500;
|
|
332
|
+
/**
|
|
333
|
+
* How long (ms) the selected pair must have stopped receiving (nothing
|
|
334
|
+
* received for {@link WEAK_CONNECTION_RECEIVE_TIMEOUT}) before the
|
|
335
|
+
* controlling agent fails over to a backup that receives, without waiting
|
|
336
|
+
* for the selected pair to become unwritable. libwebrtc:
|
|
337
|
+
* `receiving_switching_delay` (default 1000 ms).
|
|
338
|
+
*/
|
|
339
|
+
exports.RECEIVING_SWITCHING_DELAY = 1000;
|
|
256
340
|
/**
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
341
|
+
* A backup pair that received nothing for this long (ms) is dropped (its
|
|
342
|
+
* state becomes Failed) and the next pair of its socket is monitored. The
|
|
343
|
+
* same value as {@link CONSENT_TIMEOUT}. libwebrtc:
|
|
344
|
+
* `DEAD_CONNECTION_RECEIVE_TIMEOUT`.
|
|
345
|
+
*/
|
|
346
|
+
exports.DEAD_CONNECTION_RECEIVE_TIMEOUT = exports.CONSENT_TIMEOUT * 1000;
|
|
347
|
+
/**
|
|
348
|
+
* Response timeout (ms) of a backup check while the pair's RTT is still
|
|
349
|
+
* unknown (it never answered a check of this agent). libwebrtc starts a
|
|
350
|
+
* connection's RTT estimate at `DEFAULT_RTT` (3000 ms); the consent default
|
|
351
|
+
* ({@link CONSENT_RESPONSE_TIMEOUT}, 1 s) would never let a backup path
|
|
352
|
+
* slower than that become valid. Once the pair answered, the timeout follows
|
|
353
|
+
* its RTT ({@link consentResponseTimeoutMs}).
|
|
354
|
+
*/
|
|
355
|
+
exports.BACKUP_UNKNOWN_RTT_RESPONSE_TIMEOUT = 3000;
|
|
356
|
+
/**
|
|
357
|
+
* After the selected pair's consent expired (RFC 7675: no more application
|
|
358
|
+
* data on it), how long (ms) the agent stays `disconnected` waiting for the
|
|
359
|
+
* selection to move to a writable backup (its own failover nomination, or
|
|
360
|
+
* the peer's when controlled) before it fails. A peer that fails over does
|
|
361
|
+
* so 5–10 s after the path broke, long before the 30 s expiry; the grace
|
|
362
|
+
* covers a nomination still in flight. werift's own value.
|
|
363
|
+
*/
|
|
364
|
+
exports.FAILOVER_CONSENT_EXPIRED_GRACE = 10000;
|
|
365
|
+
/**
|
|
366
|
+
* Pairs of one local socket (or TURN allocation) tried as its backup before
|
|
367
|
+
* the socket waits for a retry (1, 2, 4, 8, 16 s, then every 16 s) and starts
|
|
368
|
+
* again from its highest-priority pair. werift's own limit.
|
|
369
|
+
*/
|
|
370
|
+
exports.FAILOVER_BACKUP_ATTEMPTS = 3;
|
|
371
|
+
/**
|
|
372
|
+
* Consecutive responses a pair the agent failed over from needs before the
|
|
373
|
+
* selection may move back to it (or to another pair of its socket). Keeps
|
|
374
|
+
* the selection from flapping. werift's own value (libwebrtc relies on
|
|
375
|
+
* {@link MIN_PINGS_AT_WEAK_PING_INTERVAL} for the same purpose).
|
|
376
|
+
*/
|
|
377
|
+
exports.FAILOVER_RECOVERY_RESPONSES = 3;
|
|
378
|
+
/**
|
|
379
|
+
* Between pairs of equal state and priority, the selection moves only to a
|
|
380
|
+
* pair whose smoothed RTT ({@link CandidatePair.smoothedRtt}) is at least this
|
|
381
|
+
* much (ms) lower. libwebrtc: `kMinImprovement`.
|
|
382
|
+
* @see tests/ice/selection-controller.test.ts "equal priority: a pair only 9 ms faster does not take the selection"
|
|
383
|
+
*/
|
|
384
|
+
exports.RTT_SWITCH_MIN_IMPROVEMENT = 10;
|
|
385
|
+
/**
|
|
386
|
+
* The RTT samples {@link CandidatePair.smoothedRtt} keeps (the most recent
|
|
387
|
+
* ones). werift's own value: libwebrtc keeps a moving average instead, which
|
|
388
|
+
* one outlier still moves.
|
|
389
|
+
* @see tests/ice/selection-controller.test.ts "the median of the last 5 samples: one outlier does not move it"
|
|
390
|
+
*/
|
|
391
|
+
exports.RTT_SMOOTHING_SAMPLES = 5;
|
|
392
|
+
/**
|
|
393
|
+
* Samples a pair needs before {@link CandidatePair.smoothedRtt} has a value
|
|
394
|
+
* (the RTT takes part in a switch). The same as
|
|
395
|
+
* {@link MIN_PINGS_AT_WEAK_PING_INTERVAL}: a backup is stable from then on.
|
|
396
|
+
* @see tests/ice/selection-controller.test.ts "the median of the last 5 samples: one outlier does not move it"
|
|
397
|
+
*/
|
|
398
|
+
exports.RTT_SMOOTHING_MIN_SAMPLES = 3;
|
|
399
|
+
/**
|
|
400
|
+
* RTT-based response deadline (ms) from a pair RTT (seconds): when a consent
|
|
401
|
+
* request without a response counts as unanswered (failover's pacing and
|
|
402
|
+
* writability), and the response timeout of a backup check once the backup's
|
|
403
|
+
* RTT is known. Uses 2×RTT + 200ms jitter margin, floored at
|
|
404
|
+
* {@link CONSENT_RESPONSE_TIMEOUT_MIN}. Falls back to
|
|
405
|
+
* {@link CONSENT_RESPONSE_TIMEOUT} when RTT is unavailable.
|
|
406
|
+
*
|
|
407
|
+
* A consent request's transaction is not ended at this deadline: it stays
|
|
408
|
+
* open for {@link CONSENT_TIMEOUT}, so a response slower than the estimate
|
|
409
|
+
* (an RTT that rose after the selection) still refreshes the consent.
|
|
260
410
|
*/
|
|
261
411
|
function consentResponseTimeoutMs(rttSeconds) {
|
|
262
412
|
if (rttSeconds === undefined ||
|