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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectionController.js","sourceRoot":"","sources":["../../../../../ice/src/nomination/selectionController.ts"],"names":[],"mappings":"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","sourcesContent":["import { notReceivingSince, type PairLiveness } from \"../failover\";\nimport {\n type CandidatePair,\n RECEIVING_SWITCHING_DELAY,\n RTT_SWITCH_MIN_IMPROVEMENT,\n WEAK_CONNECTION_RECEIVE_TIMEOUT,\n} from \"../iceBase\";\nimport { debug } from \"../imports/common\";\n\nconst log = debug(\n \"werift-ice : packages/ice/src/nomination/selectionController.ts : log\",\n);\n\n/** What `shouldSwitch` knows about a pair. */\nexport type SwitchPairState = {\n /** A response to a check came back and the pair is not unwritable (`isWritable`). */\n writable: boolean;\n /** The last response, request or application data received on the pair (ms). */\n lastReceived: number;\n /**\n * When the first of the consecutive unanswered checks of the pair was\n * counted (ms, `PairLiveness.missedSince`); undefined while its last check\n * was answered.\n */\n missedSince?: number;\n /** The smoothed RTT (seconds, `CandidatePair.smoothedRtt`); undefined: not known yet. */\n rtt?: number;\n};\n\n/**\n * Why a pair wins over the selected one (`shouldSwitch`):\n * - `writable`: the selection is not writable;\n * - `receiving`: the selection has not been receiving for\n * `RECEIVING_SWITCHING_DELAY`, the pair is receiving;\n * - `priority`: the pair outranks the selection;\n * - `rtt`: equal otherwise, the pair's smoothed RTT is at least\n * `RTT_SWITCH_MIN_IMPROVEMENT` lower.\n */\nexport type SwitchReason = \"writable\" | \"receiving\" | \"priority\" | \"rtt\";\n\nexport type SwitchDecision = {\n /** The pair wins over the selection; undefined: the selection stays. */\n reason?: SwitchReason;\n /**\n * When (ms) to decide again while a receiving switch is held back\n * (libwebrtc's recheck event).\n * @see tests/ice/selection-controller.test.ts \"a pair that wins only by receiving waits RECEIVING_SWITCHING_DELAY and asks for a recheck\"\n */\n recheckAt?: number;\n};\n\nexport { notReceivingSince };\n\n/**\n * Whether the controlling agent moves the selection from `selected` to\n * `candidate` (`priority` > 0: `candidate` outranks it), as libwebrtc's\n * `BasicIceController::ShouldSwitchConnection`: writable, receiving (held for\n * `RECEIVING_SWITCHING_DELAY`), priority, then the smoothed RTT. The network\n * cost libwebrtc compares before the priority is unknown in Node.js.\n * @see tests/ice/selection-controller.test.ts \"state comes before priority and priority before RTT\"\n * @see tests/ice/selection-controller.test.ts \"a pair that wins only by receiving waits RECEIVING_SWITCHING_DELAY and asks for a recheck\"\n * @see tests/ice/selection-controller.test.ts \"silence alone (no unanswered check) is not 'not receiving'; a receiving selection beats a pair that is not\"\n * @see tests/ice/selection-controller.test.ts \"a late unanswered check starts the hold at the check, and a recovery in the hold keeps the selection\"\n * @see tests/ice/selection-controller.test.ts \"equal priority: moves only to a pair whose smoothed RTT is at least 10 ms lower\"\n */\nexport function shouldSwitch({\n selected,\n candidate,\n priority,\n now,\n receivingSwitchingDelay = RECEIVING_SWITCHING_DELAY,\n receivingTimeout = WEAK_CONNECTION_RECEIVE_TIMEOUT,\n minRttImprovement = RTT_SWITCH_MIN_IMPROVEMENT,\n}: {\n selected: SwitchPairState;\n candidate: SwitchPairState;\n priority: number;\n now: number;\n receivingSwitchingDelay?: number;\n receivingTimeout?: number;\n minRttImprovement?: number;\n}): SwitchDecision {\n if (!candidate.writable) return {};\n if (!selected.writable) return { reason: \"writable\" };\n\n let recheckAt: number | undefined;\n const selectedSince = notReceivingSince(selected, now, receivingTimeout);\n const candidateSince = notReceivingSince(candidate, now, receivingTimeout);\n if (selectedSince === undefined && candidateSince !== undefined) return {};\n if (selectedSince !== undefined && candidateSince === undefined) {\n if (now - selectedSince >= receivingSwitchingDelay) {\n return { reason: \"receiving\" };\n }\n recheckAt = selectedSince + receivingSwitchingDelay;\n }\n\n if (priority > 0) return { reason: \"priority\", recheckAt };\n if (priority < 0) return { recheckAt };\n\n if (\n candidate.rtt !== undefined &&\n selected.rtt !== undefined &&\n candidate.rtt * 1000 <= selected.rtt * 1000 - minRttImprovement\n ) {\n return { reason: \"rtt\", recheckAt };\n }\n return { recheckAt };\n}\n\n/** What the agent supplies to its `SelectionController`. */\nexport type SelectionControllerHost = {\n /**\n * The controller applies now: a controlling full agent with\n * semi-aggressive nomination or renomination within the failover scope,\n * a selection that is up (failover handles one that stopped answering)\n * and no nominating check in flight.\n */\n active: () => boolean;\n selected: () => CandidatePair | undefined;\n /** The pairs the selection may move to (the monitored backups). */\n candidates: () => readonly CandidatePair[];\n /** The liveness the failover monitor keeps for `pair`. */\n liveness: (pair: CandidatePair) => PairLiveness | undefined;\n writable: (pair: CandidatePair, now: number) => boolean;\n /** `IceOptions.failover` thresholds (`receivingTimeout`, `receivingSwitchingDelay`). */\n thresholds?: () => {\n receivingTimeout: number;\n receivingSwitchingDelay: number;\n };\n /** `pair` may be nominated (not on a path the agent failed over from). */\n allows: (pair: CandidatePair) => boolean;\n /** > 0 when `pair` outranks `other` (pair priority). */\n comparePriority: (pair: CandidatePair, other: CandidatePair) => number;\n /** Nominate `pair` to replace the selection for `reason`. */\n switchTo: (pair: CandidatePair, reason: \"receiving\" | \"rtt\") => void;\n};\n\n/**\n * The controlling agent's moves of the selected pair by receiving state and\n * RTT (`shouldSwitch`), as libwebrtc's ICE controller.\n * @see tests/ice/selection-controller.test.ts \"equal priority: the selection moves to the pair whose RTT is 11 ms lower, nominating it\"\n * @see tests/ice/selection-controller.test.ts \"receiving: a selection that recovers within RECEIVING_SWITCHING_DELAY stays; one that does not moves after it\"\n * @see tests/ice/selection-controller.test.ts \"the hold is counted from the unanswered check: no switch right after it, the recheck at its end switches\"\n * @see tests/ice/selection-controller.test.ts \"controlled: the agent does not switch by RTT itself (it follows the peer's nominations)\"\n */\nexport class SelectionController {\n private recheck?: { at: number; timer: ReturnType<typeof setTimeout> };\n private readonly host: SelectionControllerHost;\n\n constructor(host: SelectionControllerHost) {\n this.host = host;\n }\n\n /** Decide whether the selection moves, and nominate the pair it moves to. */\n evaluate() {\n this.clearRecheck();\n if (!this.host.active()) return;\n const selected = this.host.selected();\n if (!selected) return;\n const selectedLiveness = this.host.liveness(selected);\n if (!selectedLiveness) return;\n const now = Date.now();\n const thresholds = this.host.thresholds?.();\n const selectedState: SwitchPairState = {\n writable: this.host.writable(selected, now),\n lastReceived: selectedLiveness.lastReceived,\n missedSince: selectedLiveness.missedSince,\n rtt: selected.smoothedRtt,\n };\n\n let best:\n | { pair: CandidatePair; reason: \"receiving\" | \"rtt\"; receiving: boolean }\n | undefined;\n let recheckAt: number | undefined;\n for (const pair of this.host.candidates()) {\n if (pair === selected || !this.host.allows(pair)) continue;\n const liveness = this.host.liveness(pair);\n if (!liveness) continue;\n const candidateState: SwitchPairState = {\n writable: this.host.writable(pair, now),\n lastReceived: liveness.lastReceived,\n missedSince: liveness.missedSince,\n rtt: pair.smoothedRtt,\n };\n const decision = shouldSwitch({\n selected: selectedState,\n candidate: candidateState,\n priority: this.host.comparePriority(pair, selected),\n now,\n receivingTimeout: thresholds?.receivingTimeout,\n receivingSwitchingDelay: thresholds?.receivingSwitchingDelay,\n });\n if (decision.recheckAt !== undefined) {\n recheckAt = Math.min(recheckAt ?? Infinity, decision.recheckAt);\n }\n // Test: tests/ice/selection-controller.test.ts \"a backup that wins by priority or over an unwritable selection is left to SelectionReplacement and the failover\"\n const reason = decision.reason;\n if (reason !== \"receiving\" && reason !== \"rtt\") continue;\n const receiving =\n notReceivingSince(candidateState, now, thresholds?.receivingTimeout) ===\n undefined;\n if (!best || this.betterTarget({ pair, receiving }, best)) {\n best = { pair, reason, receiving };\n }\n }\n if (best) {\n log(\"switch selection\", best.reason, best.pair.toJSON(), {\n selected: selected.toJSON(),\n rtt: best.pair.smoothedRtt,\n selectedRtt: selected.smoothedRtt,\n });\n this.host.switchTo(best.pair, best.reason);\n return;\n }\n if (recheckAt !== undefined) this.scheduleRecheck(recheckAt);\n }\n\n /** Stop the pending recheck (restart, close, the failover monitor reset). */\n stop() {\n this.clearRecheck();\n }\n\n /**\n * Whether `a` is a better target than `b`: receiving, priority, then RTT.\n * @see tests/ice/selection-controller.test.ts \"a receiving backup of lower priority wins over a silent one of equal priority and lower RTT\"\n * @see tests/ice/selection-controller.test.ts \"among receiving backups the higher priority wins, then the lower RTT\"\n */\n private betterTarget(\n a: { pair: CandidatePair; receiving: boolean },\n b: { pair: CandidatePair; receiving: boolean },\n ) {\n if (a.receiving !== b.receiving) return a.receiving;\n const priority = this.host.comparePriority(a.pair, b.pair);\n if (priority !== 0) return priority > 0;\n return (a.pair.smoothedRtt ?? Infinity) < (b.pair.smoothedRtt ?? Infinity);\n }\n\n private scheduleRecheck(at: number) {\n this.recheck = {\n at,\n timer: setTimeout(\n () => {\n this.recheck = undefined;\n this.evaluate();\n },\n Math.max(0, at - Date.now()),\n ),\n };\n }\n\n private clearRecheck() {\n if (this.recheck) clearTimeout(this.recheck.timer);\n this.recheck = undefined;\n }\n}\n"]}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { type CandidatePair } from "../iceBase";
|
|
2
|
+
import { type Address } from "../imports/common";
|
|
3
|
+
import type { Protocol } from "../types/model";
|
|
4
|
+
import type { NominationOutcome } from "./regularNomination";
|
|
5
|
+
/**
|
|
6
|
+
* Semi-aggressive nomination and renomination: delays before a failed pair
|
|
7
|
+
* that outranks the selection is checked again (`retryOutrankingPair`), one
|
|
8
|
+
* per retry. As libwebrtc keeps pinging a connection until it has heard
|
|
9
|
+
* nothing for 30 s, the retries end about 31 s after the failure.
|
|
10
|
+
*/
|
|
11
|
+
export declare const OUTRANKING_RETRY_DELAYS_MS: readonly [1000, 2000, 4000, 8000, 16000];
|
|
12
|
+
/** What the agent supplies to its `SelectionReplacement`. */
|
|
13
|
+
export type SelectionHost = {
|
|
14
|
+
/** The live checklist, highest priority first. */
|
|
15
|
+
checkList: () => readonly CandidatePair[];
|
|
16
|
+
/** The selected pair (`Connection.nominated`). */
|
|
17
|
+
selected: () => CandidatePair | undefined;
|
|
18
|
+
controlling: () => boolean;
|
|
19
|
+
closed: () => boolean;
|
|
20
|
+
remoteGeneration: () => number;
|
|
21
|
+
usesRenomination: () => boolean;
|
|
22
|
+
usesSemiAggressiveNomination: () => boolean;
|
|
23
|
+
/** The controlling agent may move the selection to a higher-priority pair. */
|
|
24
|
+
replacesSelection: () => boolean;
|
|
25
|
+
/** A pair semi-aggressive nomination and renomination may select (not ICE-TCP, checked locally). */
|
|
26
|
+
replacesWith: (pair: CandidatePair) => boolean;
|
|
27
|
+
outranks: (pair: CandidatePair, other: CandidatePair) => boolean;
|
|
28
|
+
bestValidPair: (pairs: CandidatePair[]) => CandidatePair | undefined;
|
|
29
|
+
isTcpPair: (pair: CandidatePair) => boolean;
|
|
30
|
+
/** Start the ordinary check of `pair` (its handle is kept on the pair). */
|
|
31
|
+
check: (pair: CandidatePair) => void;
|
|
32
|
+
/** Apply the outcome of `pair` (`Connection.checkComplete`). */
|
|
33
|
+
complete: (pair: CandidatePair) => void;
|
|
34
|
+
/** Send the nominating check (USE-CANDIDATE, or NOMINATION `value`); never rejects. */
|
|
35
|
+
sendNomination: (pair: CandidatePair, signal: AbortSignal, value?: number) => Promise<NominationOutcome>;
|
|
36
|
+
/** A nomination of `pair` sent in remote `generation` no longer applies. */
|
|
37
|
+
isStaleNomination: (pair: CandidatePair, generation: number) => boolean;
|
|
38
|
+
/** 487: the peer is controlling and wins; the agent becomes controlled. */
|
|
39
|
+
roleConflict: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Failover: `pair` may be nominated to move the selection up (its socket
|
|
42
|
+
* is not one the agent failed over from and has not recovered yet, and it
|
|
43
|
+
* is not known to be unwritable). Unset: every pair.
|
|
44
|
+
*/
|
|
45
|
+
allows?: (pair: CandidatePair) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Failover (controlling): the nominated `pair` replaces the selection
|
|
48
|
+
* whatever its priority (the selection stopped answering, or it is the
|
|
49
|
+
* failover nomination's pair).
|
|
50
|
+
*/
|
|
51
|
+
failoverReplaces?: (pair: CandidatePair) => boolean;
|
|
52
|
+
/** The nominating check of `pair` ended (any outcome, or aborted). */
|
|
53
|
+
nominationEnded?: (pair: CandidatePair) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Failover applies (`Connection.failoverEnabled`): the retries of failed
|
|
56
|
+
* pairs that outrank the selection go on every last delay (16 s) instead
|
|
57
|
+
* of stopping after `OUTRANKING_RETRY_DELAYS_MS`.
|
|
58
|
+
*/
|
|
59
|
+
retriesForever?: () => boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Controlled agent: the selected pair stopped answering (failover), so a
|
|
62
|
+
* nomination of the peer equal to the selection's replaces it.
|
|
63
|
+
*/
|
|
64
|
+
selectionDown?: () => boolean;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Semi-aggressive nomination and renomination (as libwebrtc): how a selection
|
|
68
|
+
* is replaced after the first one.
|
|
69
|
+
*
|
|
70
|
+
* - Controlling: the pairs that outrank the selection go on being checked
|
|
71
|
+
* (`checkOutrankingPairs`), a failed one again after
|
|
72
|
+
* `OUTRANKING_RETRY_DELAYS_MS` (`scheduleRetries`), and the best valid pair
|
|
73
|
+
* is nominated with a separate check when no check of it did
|
|
74
|
+
* (`evaluate`; renomination sends increasing NOMINATION values).
|
|
75
|
+
* - Controlled: between equal nominations the pair the peer sends data on
|
|
76
|
+
* wins (`controlledDataReceived`, `replaces`).
|
|
77
|
+
*/
|
|
78
|
+
export declare class SelectionReplacement {
|
|
79
|
+
/**
|
|
80
|
+
* Semi-aggressive nomination or renomination: the separate check that
|
|
81
|
+
* nominates a valid pair which outranks the selection (see
|
|
82
|
+
* `evaluate`). One at a time.
|
|
83
|
+
*/
|
|
84
|
+
private inFlight?;
|
|
85
|
+
/** The last NOMINATION value sent (renomination); it only increases. */
|
|
86
|
+
private nominationValue;
|
|
87
|
+
/** `checkOutrankingPairs` is running. */
|
|
88
|
+
private outrankingChecks;
|
|
89
|
+
/**
|
|
90
|
+
* Controlled agent: when each live pair last received application data
|
|
91
|
+
* (an increasing sequence, larger is more recent). Between nominated pairs
|
|
92
|
+
* of equal nomination, the one the peer sends on wins (`replaces`).
|
|
93
|
+
*/
|
|
94
|
+
private readonly lastData;
|
|
95
|
+
private dataSequence;
|
|
96
|
+
/**
|
|
97
|
+
* Retries of failed pairs that outrank the selection
|
|
98
|
+
* (`scheduleRetries`): how many ran, and the pending timer.
|
|
99
|
+
*/
|
|
100
|
+
private readonly retries;
|
|
101
|
+
/**
|
|
102
|
+
* Semi-aggressive nomination and renomination (controlling): a pair that
|
|
103
|
+
* outranks the selection but failed (a check or nomination that went
|
|
104
|
+
* unanswered, e.g. while the path was briefly down) is checked again after
|
|
105
|
+
* `OUTRANKING_RETRY_DELAYS_MS`, as libwebrtc keeps pinging its
|
|
106
|
+
* connections. Without it the agents stay on the lower path when the
|
|
107
|
+
* peer does not trigger a check on that pair either (e.g. its own check
|
|
108
|
+
* failed too). Each pair waits for one retry at a time.
|
|
109
|
+
*/
|
|
110
|
+
scheduleRetries(): void;
|
|
111
|
+
/**
|
|
112
|
+
* Failover (controlling): the selection stopped answering and no backup
|
|
113
|
+
* is writable, so the failed pairs that outrank it are checked at once
|
|
114
|
+
* instead of waiting for their next retry (libwebrtc pings at its strong
|
|
115
|
+
* interval when no connection is writable). One check per pair at a time:
|
|
116
|
+
* a pair being checked is not Failed.
|
|
117
|
+
*/
|
|
118
|
+
checkFailedOutranking(): void;
|
|
119
|
+
/** `pair` failed, outranks `selected` and may replace it. */
|
|
120
|
+
private retriesOutranking;
|
|
121
|
+
/** A retry of `scheduleRetries` is due: check `pair` again. */
|
|
122
|
+
private retryOutrankingPair;
|
|
123
|
+
/** `pair` succeeded: its retries of `scheduleRetries` are over. */
|
|
124
|
+
forgetRetry(pair: CandidatePair): void;
|
|
125
|
+
/** Stop the retries of `scheduleRetries` (restart, close, role change). */
|
|
126
|
+
clearRetries(): void;
|
|
127
|
+
/**
|
|
128
|
+
* Whether the nominated `pair` replaces the selected pair:
|
|
129
|
+
* - controlled: the peer's larger nomination (the NOMINATION value;
|
|
130
|
+
* USE-CANDIDATE counts as 1, as in libwebrtc), the higher-priority pair
|
|
131
|
+
* between equal ones (RFC 5245 §8.1.1.2: the highest-priority nominated
|
|
132
|
+
* pair is used). A controlling peer nominating once (regular nomination)
|
|
133
|
+
* never causes a switch.
|
|
134
|
+
* - controlling with renomination: the pair renominated last.
|
|
135
|
+
* - controlling, semi-aggressive: a higher-priority pair.
|
|
136
|
+
* - controlling, regular nomination or toward ICE-lite: never.
|
|
137
|
+
*/
|
|
138
|
+
replaces(pair: CandidatePair): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Controlled agent: application data arrived on the live pair of
|
|
141
|
+
* `protocol` and `addr`. Record it (`lastData`) and, when the pair is
|
|
142
|
+
* nominated but not selected, let it replace the selection if the peer
|
|
143
|
+
* now sends on it (`replaces`). ICE-TCP pairs only record:
|
|
144
|
+
* selecting one prunes the other TCP connections.
|
|
145
|
+
*/
|
|
146
|
+
controlledDataReceived(protocol: Protocol, addr: Address): void;
|
|
147
|
+
/**
|
|
148
|
+
* Semi-aggressive nomination and renomination: nominate the best valid
|
|
149
|
+
* pair with a separate check when it outranks the selection (or nothing is
|
|
150
|
+
* selected yet) and no check of it nominated it already. With renomination
|
|
151
|
+
* ordinary checks never nominate; with semi-aggressive nomination a pair
|
|
152
|
+
* whose check went without USE-CANDIDATE (sent while controlled) still
|
|
153
|
+
* needs one. One such check at a time; its outcome re-evaluates.
|
|
154
|
+
*/
|
|
155
|
+
evaluate(): void;
|
|
156
|
+
/**
|
|
157
|
+
* Failover (controlling): nominate `pair` now (USE-CANDIDATE, or the next
|
|
158
|
+
* NOMINATION value), whatever its priority; its success moves the
|
|
159
|
+
* selection (`replaces` with `failoverReplaces`).
|
|
160
|
+
*/
|
|
161
|
+
nominate(pair: CandidatePair): void;
|
|
162
|
+
private allows;
|
|
163
|
+
private nominateSelection;
|
|
164
|
+
abort(): void;
|
|
165
|
+
/**
|
|
166
|
+
* After the first selection (semi-aggressive nomination, renomination):
|
|
167
|
+
* check the pairs that outrank the selected one, paced like the ordinary
|
|
168
|
+
* schedule. A pair added later that outranks it (a trickled candidate, a
|
|
169
|
+
* late relay allocation) restarts it (`addPair`).
|
|
170
|
+
*/
|
|
171
|
+
checkOutrankingPairs(): Promise<void>;
|
|
172
|
+
private readonly host;
|
|
173
|
+
constructor(host: SelectionHost);
|
|
174
|
+
/** A nominating check of `evaluate` is in flight. */
|
|
175
|
+
get nominating(): boolean;
|
|
176
|
+
/** The next NOMINATION value (renomination); it only increases. */
|
|
177
|
+
nextNominationValue(): number;
|
|
178
|
+
}
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SelectionReplacement = exports.OUTRANKING_RETRY_DELAYS_MS = void 0;
|
|
37
|
+
const timers = __importStar(require("node:timers/promises"));
|
|
38
|
+
const iceBase_1 = require("../iceBase");
|
|
39
|
+
const common_1 = require("../imports/common");
|
|
40
|
+
const log = (0, common_1.debug)("werift-ice : packages/ice/src/nomination/selectionReplacement.ts : log");
|
|
41
|
+
/**
|
|
42
|
+
* Semi-aggressive nomination and renomination: delays before a failed pair
|
|
43
|
+
* that outranks the selection is checked again (`retryOutrankingPair`), one
|
|
44
|
+
* per retry. As libwebrtc keeps pinging a connection until it has heard
|
|
45
|
+
* nothing for 30 s, the retries end about 31 s after the failure.
|
|
46
|
+
*/
|
|
47
|
+
exports.OUTRANKING_RETRY_DELAYS_MS = [
|
|
48
|
+
1000, 2000, 4000, 8000, 16000,
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* Semi-aggressive nomination and renomination (as libwebrtc): how a selection
|
|
52
|
+
* is replaced after the first one.
|
|
53
|
+
*
|
|
54
|
+
* - Controlling: the pairs that outrank the selection go on being checked
|
|
55
|
+
* (`checkOutrankingPairs`), a failed one again after
|
|
56
|
+
* `OUTRANKING_RETRY_DELAYS_MS` (`scheduleRetries`), and the best valid pair
|
|
57
|
+
* is nominated with a separate check when no check of it did
|
|
58
|
+
* (`evaluate`; renomination sends increasing NOMINATION values).
|
|
59
|
+
* - Controlled: between equal nominations the pair the peer sends data on
|
|
60
|
+
* wins (`controlledDataReceived`, `replaces`).
|
|
61
|
+
*/
|
|
62
|
+
class SelectionReplacement {
|
|
63
|
+
/**
|
|
64
|
+
* Semi-aggressive nomination and renomination (controlling): a pair that
|
|
65
|
+
* outranks the selection but failed (a check or nomination that went
|
|
66
|
+
* unanswered, e.g. while the path was briefly down) is checked again after
|
|
67
|
+
* `OUTRANKING_RETRY_DELAYS_MS`, as libwebrtc keeps pinging its
|
|
68
|
+
* connections. Without it the agents stay on the lower path when the
|
|
69
|
+
* peer does not trigger a check on that pair either (e.g. its own check
|
|
70
|
+
* failed too). Each pair waits for one retry at a time.
|
|
71
|
+
*/
|
|
72
|
+
scheduleRetries() {
|
|
73
|
+
const selected = this.host.selected();
|
|
74
|
+
if (!selected ||
|
|
75
|
+
this.host.closed() ||
|
|
76
|
+
!this.host.controlling() ||
|
|
77
|
+
!this.host.replacesSelection()) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
for (const pair of this.host.checkList()) {
|
|
81
|
+
if (!this.retriesOutranking(pair, selected))
|
|
82
|
+
continue;
|
|
83
|
+
let entry = this.retries.get(pair);
|
|
84
|
+
if (!entry) {
|
|
85
|
+
entry = { retries: 0 };
|
|
86
|
+
this.retries.set(pair, entry);
|
|
87
|
+
}
|
|
88
|
+
const forever = this.host.retriesForever?.() ?? false;
|
|
89
|
+
if (entry.timer !== undefined ||
|
|
90
|
+
(!forever && entry.retries >= exports.OUTRANKING_RETRY_DELAYS_MS.length)) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const current = entry;
|
|
94
|
+
const remoteGeneration = this.host.remoteGeneration();
|
|
95
|
+
const delay = exports.OUTRANKING_RETRY_DELAYS_MS[Math.min(current.retries, exports.OUTRANKING_RETRY_DELAYS_MS.length - 1)];
|
|
96
|
+
current.timer = setTimeout(() => {
|
|
97
|
+
current.timer = undefined;
|
|
98
|
+
current.retries++;
|
|
99
|
+
this.retryOutrankingPair(pair, remoteGeneration);
|
|
100
|
+
}, delay);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Failover (controlling): the selection stopped answering and no backup
|
|
105
|
+
* is writable, so the failed pairs that outrank it are checked at once
|
|
106
|
+
* instead of waiting for their next retry (libwebrtc pings at its strong
|
|
107
|
+
* interval when no connection is writable). One check per pair at a time:
|
|
108
|
+
* a pair being checked is not Failed.
|
|
109
|
+
*/
|
|
110
|
+
checkFailedOutranking() {
|
|
111
|
+
const selected = this.host.selected();
|
|
112
|
+
if (!selected ||
|
|
113
|
+
this.host.closed() ||
|
|
114
|
+
!this.host.controlling() ||
|
|
115
|
+
!this.host.replacesSelection()) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
for (const pair of this.host.checkList()) {
|
|
119
|
+
if (!this.retriesOutranking(pair, selected))
|
|
120
|
+
continue;
|
|
121
|
+
log("check failed outranking pair at once", pair.toJSON());
|
|
122
|
+
this.host.check(pair);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/** `pair` failed, outranks `selected` and may replace it. */
|
|
126
|
+
retriesOutranking(pair, selected) {
|
|
127
|
+
return (pair.state === iceBase_1.CandidatePairState.FAILED &&
|
|
128
|
+
this.host.replacesWith(pair) &&
|
|
129
|
+
this.host.outranks(pair, selected) &&
|
|
130
|
+
this.allows(pair));
|
|
131
|
+
}
|
|
132
|
+
/** A retry of `scheduleRetries` is due: check `pair` again. */
|
|
133
|
+
retryOutrankingPair(pair, remoteGeneration) {
|
|
134
|
+
const selected = this.host.selected();
|
|
135
|
+
if (!selected ||
|
|
136
|
+
this.host.closed() ||
|
|
137
|
+
this.host.remoteGeneration() !== remoteGeneration ||
|
|
138
|
+
!this.host.controlling() ||
|
|
139
|
+
!this.host.replacesSelection() ||
|
|
140
|
+
!this.host.checkList().includes(pair) ||
|
|
141
|
+
!this.retriesOutranking(pair, selected)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
log("retry outranking pair", pair.toJSON());
|
|
145
|
+
// One check per due retry (each pair has its own timer), so it starts
|
|
146
|
+
// at once instead of waiting for the paced `checkOutrankingPairs`.
|
|
147
|
+
this.host.check(pair);
|
|
148
|
+
}
|
|
149
|
+
/** `pair` succeeded: its retries of `scheduleRetries` are over. */
|
|
150
|
+
forgetRetry(pair) {
|
|
151
|
+
const entry = this.retries.get(pair);
|
|
152
|
+
if (!entry)
|
|
153
|
+
return;
|
|
154
|
+
if (entry.timer !== undefined)
|
|
155
|
+
clearTimeout(entry.timer);
|
|
156
|
+
this.retries.delete(pair);
|
|
157
|
+
}
|
|
158
|
+
/** Stop the retries of `scheduleRetries` (restart, close, role change). */
|
|
159
|
+
clearRetries() {
|
|
160
|
+
for (const entry of this.retries.values()) {
|
|
161
|
+
if (entry.timer !== undefined)
|
|
162
|
+
clearTimeout(entry.timer);
|
|
163
|
+
}
|
|
164
|
+
this.retries.clear();
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Whether the nominated `pair` replaces the selected pair:
|
|
168
|
+
* - controlled: the peer's larger nomination (the NOMINATION value;
|
|
169
|
+
* USE-CANDIDATE counts as 1, as in libwebrtc), the higher-priority pair
|
|
170
|
+
* between equal ones (RFC 5245 §8.1.1.2: the highest-priority nominated
|
|
171
|
+
* pair is used). A controlling peer nominating once (regular nomination)
|
|
172
|
+
* never causes a switch.
|
|
173
|
+
* - controlling with renomination: the pair renominated last.
|
|
174
|
+
* - controlling, semi-aggressive: a higher-priority pair.
|
|
175
|
+
* - controlling, regular nomination or toward ICE-lite: never.
|
|
176
|
+
*/
|
|
177
|
+
replaces(pair) {
|
|
178
|
+
const selected = this.host.selected();
|
|
179
|
+
if (!selected || selected === pair)
|
|
180
|
+
return false;
|
|
181
|
+
if (!this.host.controlling()) {
|
|
182
|
+
if (pair.remoteNomination !== selected.remoteNomination) {
|
|
183
|
+
return pair.remoteNomination > selected.remoteNomination;
|
|
184
|
+
}
|
|
185
|
+
// Failover: the selected pair stopped answering and the peer
|
|
186
|
+
// nominates a valid pair as strongly as the selection (USE-CANDIDATE
|
|
187
|
+
// again): it replaces the selection without waiting for data, as
|
|
188
|
+
// libwebrtc's controlled agent ranks a writable connection first.
|
|
189
|
+
if (this.host.selectionDown?.() &&
|
|
190
|
+
pair.state === iceBase_1.CandidatePairState.SUCCEEDED) {
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
// Equal nominations: the pair the peer last sent data on, as libwebrtc
|
|
194
|
+
// (the peer's own selection may move to a lower-priority pair, e.g.
|
|
195
|
+
// when the selected one stopped working).
|
|
196
|
+
const received = this.lastData.get(pair) ?? 0;
|
|
197
|
+
const selectedReceived = this.lastData.get(selected) ?? 0;
|
|
198
|
+
if (received !== selectedReceived)
|
|
199
|
+
return received > selectedReceived;
|
|
200
|
+
return this.host.outranks(pair, selected);
|
|
201
|
+
}
|
|
202
|
+
if (!this.host.replacesWith(pair))
|
|
203
|
+
return false;
|
|
204
|
+
if (this.host.failoverReplaces?.(pair))
|
|
205
|
+
return true;
|
|
206
|
+
if (this.host.usesRenomination())
|
|
207
|
+
return pair.nomination > selected.nomination;
|
|
208
|
+
if (this.host.usesSemiAggressiveNomination()) {
|
|
209
|
+
return this.host.outranks(pair, selected);
|
|
210
|
+
}
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Controlled agent: application data arrived on the live pair of
|
|
215
|
+
* `protocol` and `addr`. Record it (`lastData`) and, when the pair is
|
|
216
|
+
* nominated but not selected, let it replace the selection if the peer
|
|
217
|
+
* now sends on it (`replaces`). ICE-TCP pairs only record:
|
|
218
|
+
* selecting one prunes the other TCP connections.
|
|
219
|
+
*/
|
|
220
|
+
controlledDataReceived(protocol, addr) {
|
|
221
|
+
const selected = this.host.selected();
|
|
222
|
+
const sameAddress = (pair) => pair.protocol === protocol &&
|
|
223
|
+
pair.remoteAddr[0] === addr[0] &&
|
|
224
|
+
pair.remoteAddr[1] === addr[1];
|
|
225
|
+
const pair = selected && sameAddress(selected)
|
|
226
|
+
? selected
|
|
227
|
+
: this.host.checkList().find(sameAddress);
|
|
228
|
+
if (!pair)
|
|
229
|
+
return;
|
|
230
|
+
this.lastData.set(pair, ++this.dataSequence);
|
|
231
|
+
if (pair !== selected &&
|
|
232
|
+
pair.nominated &&
|
|
233
|
+
pair.state === iceBase_1.CandidatePairState.SUCCEEDED &&
|
|
234
|
+
!this.host.isTcpPair(pair) &&
|
|
235
|
+
this.replaces(pair)) {
|
|
236
|
+
this.host.complete(pair);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Semi-aggressive nomination and renomination: nominate the best valid
|
|
241
|
+
* pair with a separate check when it outranks the selection (or nothing is
|
|
242
|
+
* selected yet) and no check of it nominated it already. With renomination
|
|
243
|
+
* ordinary checks never nominate; with semi-aggressive nomination a pair
|
|
244
|
+
* whose check went without USE-CANDIDATE (sent while controlled) still
|
|
245
|
+
* needs one. One such check at a time; its outcome re-evaluates.
|
|
246
|
+
*/
|
|
247
|
+
evaluate() {
|
|
248
|
+
if (!this.host.replacesSelection() || this.inFlight || this.host.closed()) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
const renomination = this.host.usesRenomination();
|
|
252
|
+
const best = this.host.bestValidPair(this.host
|
|
253
|
+
.checkList()
|
|
254
|
+
.filter((pair) => this.host.replacesWith(pair) && this.allows(pair)));
|
|
255
|
+
const selected = this.host.selected();
|
|
256
|
+
if (!best || best === selected)
|
|
257
|
+
return;
|
|
258
|
+
if (selected && !this.host.outranks(best, selected))
|
|
259
|
+
return;
|
|
260
|
+
// Semi-aggressive: the USE-CANDIDATE check that succeeded selected it.
|
|
261
|
+
if (!renomination && best.nominated)
|
|
262
|
+
return;
|
|
263
|
+
void this.nominateSelection(best, renomination);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Failover (controlling): nominate `pair` now (USE-CANDIDATE, or the next
|
|
267
|
+
* NOMINATION value), whatever its priority; its success moves the
|
|
268
|
+
* selection (`replaces` with `failoverReplaces`).
|
|
269
|
+
*/
|
|
270
|
+
nominate(pair) {
|
|
271
|
+
if (this.inFlight || this.host.closed())
|
|
272
|
+
return;
|
|
273
|
+
void this.nominateSelection(pair, this.host.usesRenomination());
|
|
274
|
+
}
|
|
275
|
+
allows(pair) {
|
|
276
|
+
return this.host.allows?.(pair) ?? true;
|
|
277
|
+
}
|
|
278
|
+
async nominateSelection(pair, renomination) {
|
|
279
|
+
const current = { pair, abort: new AbortController() };
|
|
280
|
+
this.inFlight = current;
|
|
281
|
+
const value = renomination ? ++this.nominationValue : undefined;
|
|
282
|
+
const remoteGeneration = this.host.remoteGeneration();
|
|
283
|
+
log("nominate selection", pair.toJSON(), { nomination: value });
|
|
284
|
+
const outcome = await this.host.sendNomination(pair, current.abort.signal, value);
|
|
285
|
+
// A role change, restart or close replaced it.
|
|
286
|
+
if (this.inFlight !== current)
|
|
287
|
+
return;
|
|
288
|
+
this.inFlight = undefined;
|
|
289
|
+
if (this.host.isStaleNomination(pair, remoteGeneration)) {
|
|
290
|
+
this.host.nominationEnded?.(pair);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
if (outcome === "nominated") {
|
|
294
|
+
if (value !== undefined)
|
|
295
|
+
pair.nomination = value;
|
|
296
|
+
pair.nominated = true;
|
|
297
|
+
this.host.complete(pair);
|
|
298
|
+
this.host.nominationEnded?.(pair);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
this.host.nominationEnded?.(pair);
|
|
302
|
+
if (outcome === "role-conflict") {
|
|
303
|
+
// 487: the peer is controlling and wins; it nominates.
|
|
304
|
+
this.host.roleConflict();
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
// Not taken (an error, or no answer): the pair is not used and the next
|
|
308
|
+
// best valid pair is considered (checkComplete re-evaluates).
|
|
309
|
+
log("selection nomination failed", pair.toJSON(), outcome);
|
|
310
|
+
pair.updateState(iceBase_1.CandidatePairState.FAILED);
|
|
311
|
+
this.host.complete(pair);
|
|
312
|
+
}
|
|
313
|
+
abort() {
|
|
314
|
+
const inFlight = this.inFlight;
|
|
315
|
+
inFlight?.abort.abort();
|
|
316
|
+
this.inFlight = undefined;
|
|
317
|
+
if (inFlight)
|
|
318
|
+
this.host.nominationEnded?.(inFlight.pair);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* After the first selection (semi-aggressive nomination, renomination):
|
|
322
|
+
* check the pairs that outrank the selected one, paced like the ordinary
|
|
323
|
+
* schedule. A pair added later that outranks it (a trickled candidate, a
|
|
324
|
+
* late relay allocation) restarts it (`addPair`).
|
|
325
|
+
*/
|
|
326
|
+
async checkOutrankingPairs() {
|
|
327
|
+
if (this.outrankingChecks)
|
|
328
|
+
return;
|
|
329
|
+
this.outrankingChecks = true;
|
|
330
|
+
const remoteGeneration = this.host.remoteGeneration();
|
|
331
|
+
try {
|
|
332
|
+
for (;;) {
|
|
333
|
+
const selected = this.host.selected();
|
|
334
|
+
if (!selected ||
|
|
335
|
+
this.host.closed() ||
|
|
336
|
+
this.host.remoteGeneration() !== remoteGeneration ||
|
|
337
|
+
!this.host.controlling() ||
|
|
338
|
+
!this.host.replacesSelection()) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const pair = this.host
|
|
342
|
+
.checkList()
|
|
343
|
+
.find((pair) => (pair.state === iceBase_1.CandidatePairState.WAITING ||
|
|
344
|
+
pair.state === iceBase_1.CandidatePairState.FROZEN) &&
|
|
345
|
+
this.host.replacesWith(pair) &&
|
|
346
|
+
this.host.outranks(pair, selected) &&
|
|
347
|
+
this.allows(pair));
|
|
348
|
+
if (!pair)
|
|
349
|
+
return;
|
|
350
|
+
this.host.check(pair);
|
|
351
|
+
await timers.setTimeout(20);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
finally {
|
|
355
|
+
this.outrankingChecks = false;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
constructor(host) {
|
|
359
|
+
/**
|
|
360
|
+
* Semi-aggressive nomination or renomination: the separate check that
|
|
361
|
+
* nominates a valid pair which outranks the selection (see
|
|
362
|
+
* `evaluate`). One at a time.
|
|
363
|
+
*/
|
|
364
|
+
Object.defineProperty(this, "inFlight", {
|
|
365
|
+
enumerable: true,
|
|
366
|
+
configurable: true,
|
|
367
|
+
writable: true,
|
|
368
|
+
value: void 0
|
|
369
|
+
});
|
|
370
|
+
/** The last NOMINATION value sent (renomination); it only increases. */
|
|
371
|
+
Object.defineProperty(this, "nominationValue", {
|
|
372
|
+
enumerable: true,
|
|
373
|
+
configurable: true,
|
|
374
|
+
writable: true,
|
|
375
|
+
value: 0
|
|
376
|
+
});
|
|
377
|
+
/** `checkOutrankingPairs` is running. */
|
|
378
|
+
Object.defineProperty(this, "outrankingChecks", {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
configurable: true,
|
|
381
|
+
writable: true,
|
|
382
|
+
value: false
|
|
383
|
+
});
|
|
384
|
+
/**
|
|
385
|
+
* Controlled agent: when each live pair last received application data
|
|
386
|
+
* (an increasing sequence, larger is more recent). Between nominated pairs
|
|
387
|
+
* of equal nomination, the one the peer sends on wins (`replaces`).
|
|
388
|
+
*/
|
|
389
|
+
Object.defineProperty(this, "lastData", {
|
|
390
|
+
enumerable: true,
|
|
391
|
+
configurable: true,
|
|
392
|
+
writable: true,
|
|
393
|
+
value: new WeakMap()
|
|
394
|
+
});
|
|
395
|
+
Object.defineProperty(this, "dataSequence", {
|
|
396
|
+
enumerable: true,
|
|
397
|
+
configurable: true,
|
|
398
|
+
writable: true,
|
|
399
|
+
value: 0
|
|
400
|
+
});
|
|
401
|
+
/**
|
|
402
|
+
* Retries of failed pairs that outrank the selection
|
|
403
|
+
* (`scheduleRetries`): how many ran, and the pending timer.
|
|
404
|
+
*/
|
|
405
|
+
Object.defineProperty(this, "retries", {
|
|
406
|
+
enumerable: true,
|
|
407
|
+
configurable: true,
|
|
408
|
+
writable: true,
|
|
409
|
+
value: new Map()
|
|
410
|
+
});
|
|
411
|
+
Object.defineProperty(this, "host", {
|
|
412
|
+
enumerable: true,
|
|
413
|
+
configurable: true,
|
|
414
|
+
writable: true,
|
|
415
|
+
value: void 0
|
|
416
|
+
});
|
|
417
|
+
this.host = host;
|
|
418
|
+
}
|
|
419
|
+
/** A nominating check of `evaluate` is in flight. */
|
|
420
|
+
get nominating() {
|
|
421
|
+
return this.inFlight !== undefined;
|
|
422
|
+
}
|
|
423
|
+
/** The next NOMINATION value (renomination); it only increases. */
|
|
424
|
+
nextNominationValue() {
|
|
425
|
+
return ++this.nominationValue;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
exports.SelectionReplacement = SelectionReplacement;
|
|
429
|
+
//# sourceMappingURL=selectionReplacement.js.map
|