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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failover.js","sourceRoot":"","sources":["../../../../ice/src/failover.ts"],"names":[],"mappings":";;;AAAA,uCAemB;AAOnB,uEAAuE;AAC1D,QAAA,2BAA2B,GACtC,MAAM,CAAC,MAAM,CAAC;IACZ,mBAAmB,EAAE,2CAAiC;IACtD,iBAAiB,EAAE,0CAAgC;IACnD,gBAAgB,EAAE,yCAA+B;IACjD,uBAAuB,EAAE,mCAAyB;CACnD,CAAC,CAAC;AAEL;;;GAGG;AACI,MAAM,yBAAyB,GAAG,CACvC,OAAuC,EACnB,EAAE;IACtB,MAAM,IAAI,GAAG,CACX,KAAyB,EACzB,QAAgB,EAChB,KAAiC,EACjC,EAAE,CACF,OAAO,KAAK,KAAK,QAA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IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC;QACD,IACE,QAAQ;YACR,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YACpB,QAAQ,CAAC,WAAW,IAAI,qCAA2B,EACnD,CAAC;YACD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QACxB,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACpB,IAAI,CAAC,GAAG,EAAE,CAAC;IACb,CAAC;IAEO,QAAQ,CAAC,IAAmB,EAAE,KAAoB;QACxD,OAAO,CACL,IAAA,sCAA4B,EAC1B,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,eAAe,EACpB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,eAAe,EACrB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAC3B,GAAG,CAAC,CACN,CAAC;IACJ,CAAC;CACF;AA3iBD,0CA2iBC","sourcesContent":["import {\n type CandidatePair,\n CandidatePairState,\n CONNECTION_WRITE_CONNECT_FAILURES,\n CONNECTION_WRITE_CONNECT_TIMEOUT,\n compareCandidatePairPriority,\n DEAD_CONNECTION_RECEIVE_TIMEOUT,\n FAILOVER_BACKUP_ATTEMPTS,\n FAILOVER_RECOVERY_RESPONSES,\n type IceFailoverOptions,\n MIN_PINGS_AT_WEAK_PING_INTERVAL,\n RECEIVING_SWITCHING_DELAY,\n STABLE_WRITABLE_CONNECTION_PING_INTERVAL,\n WEAK_CONNECTION_RECEIVE_TIMEOUT,\n WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL,\n} from \"./iceBase\";\nimport type { Address } from \"./imports/common\";\nimport type { Protocol } from \"./types/model\";\n\n/** The thresholds in use: {@link IceFailoverOptions} with every default applied. */\nexport type FailoverThresholds = Required<IceFailoverOptions>;\n\n/** The defaults of {@link IceFailoverOptions} (libwebrtc's values). */\nexport const DEFAULT_FAILOVER_THRESHOLDS: Readonly<FailoverThresholds> =\n Object.freeze({\n unwritableMinChecks: CONNECTION_WRITE_CONNECT_FAILURES,\n unwritableTimeout: CONNECTION_WRITE_CONNECT_TIMEOUT,\n receivingTimeout: WEAK_CONNECTION_RECEIVE_TIMEOUT,\n receivingSwitchingDelay: RECEIVING_SWITCHING_DELAY,\n });\n\n/**\n * {@link IceFailoverOptions} with its defaults: an unset or invalid value\n * (not finite, out of range, a fractional check count) keeps the default.\n */\nexport const resolveFailoverThresholds = (\n options: IceFailoverOptions | undefined,\n): FailoverThresholds => {\n const pick = (\n value: number | undefined,\n fallback: number,\n valid: (value: number) => boolean,\n ) =>\n typeof value === \"number\" && Number.isFinite(value) && valid(value)\n ? value\n : fallback;\n const defaults = DEFAULT_FAILOVER_THRESHOLDS;\n return {\n unwritableMinChecks: pick(\n options?.unwritableMinChecks,\n defaults.unwritableMinChecks,\n (value) => Number.isInteger(value) && value >= 1,\n ),\n unwritableTimeout: pick(\n options?.unwritableTimeout,\n defaults.unwritableTimeout,\n (value) => value >= 0,\n ),\n receivingTimeout: pick(\n options?.receivingTimeout,\n defaults.receivingTimeout,\n (value) => value > 0,\n ),\n receivingSwitchingDelay: pick(\n options?.receivingSwitchingDelay,\n defaults.receivingSwitchingDelay,\n (value) => value >= 0,\n ),\n };\n};\n\n/**\n * A demoted path (`FailoverMonitor.demote`): undefined for a whole socket,\n * else the remote address of the path on the socket.\n */\ntype DemotedPath = string | undefined;\n\n/** The remote address of `pair`, as a key. */\nconst remoteKey = (pair: CandidatePair) =>\n `${pair.remoteAddr[0]}:${pair.remoteAddr[1]}`;\n\n/** Ta: the minimum spacing (ms) between two backup checks, as the ordinary schedule. */\nconst PACING_MS = 20;\n\n/**\n * Delays before a socket whose backup pairs all failed starts again from its\n * highest-priority pair, one per retry; after the last one it goes on every\n * last delay (16 s) while the selection lasts.\n */\nconst BACKUP_RETRY_DELAYS_MS = [1000, 2000, 4000, 8000, 16000] as const;\n\n/**\n * What the agent knows about a monitored pair (the selected pair and the\n * backups). Only a response to a check makes a pair writable: application\n * data or a request from the peer only counts as received (as RFC 7675\n * consent does not take data as consent).\n */\nexport type PairLiveness = {\n /** When the pair began to be monitored (ms, `Date.now()`). */\n since: number;\n /** The last response to a check (undefined: none since monitoring began). */\n lastResponse?: number;\n /** The last response, request or application data received on the pair. */\n lastReceived: number;\n /** Consecutive checks that went unanswered. */\n unanswered: number;\n /**\n * When the first of the `unanswered` checks was counted (ms); undefined\n * while the last check was answered (see `notReceivingSince`).\n */\n missedSince?: number;\n /** Responses since monitoring began (stabilizing below MIN_PINGS_AT_WEAK_PING_INTERVAL). */\n responses: number;\n /** Consecutive responses (reset by an unanswered check). */\n consecutive: number;\n /**\n * The path is known to be gone without waiting for checks: sending on it\n * failed with a routing error, or its TURN allocation was lost\n * (`Protocol.onPathBroken`). Unwritable until a check is answered again.\n */\n broken?: boolean;\n};\n\n/**\n * No longer writable: `unwritableMinChecks` (CONNECTION_WRITE_CONNECT_FAILURES)\n * consecutive checks unanswered and `unwritableTimeout`\n * (CONNECTION_WRITE_CONNECT_TIMEOUT) since the last response (or, for a pair\n * never answered, since monitoring began); or the path is known to be gone\n * (`broken`).\n */\nexport const isUnwritable = (\n liveness: PairLiveness,\n now: number,\n thresholds: FailoverThresholds = DEFAULT_FAILOVER_THRESHOLDS,\n) =>\n !!liveness.broken ||\n (liveness.unanswered >= thresholds.unwritableMinChecks &&\n now - (liveness.lastResponse ?? liveness.since) >=\n thresholds.unwritableTimeout);\n\n/** Answered since monitoring began and not unwritable. */\nexport const isWritable = (\n liveness: PairLiveness,\n now: number,\n thresholds: FailoverThresholds = DEFAULT_FAILOVER_THRESHOLDS,\n) =>\n liveness.lastResponse !== undefined &&\n !isUnwritable(liveness, now, thresholds);\n\n/** The last check went unanswered, or nothing was received for `receivingTimeout` (WEAK_CONNECTION_RECEIVE_TIMEOUT). */\nexport const isWeak = (\n liveness: PairLiveness,\n now: number,\n thresholds: FailoverThresholds = DEFAULT_FAILOVER_THRESHOLDS,\n) =>\n liveness.unanswered > 0 ||\n now - liveness.lastReceived >= thresholds.receivingTimeout;\n\n/**\n * Since when (ms) `pair` has not been receiving, undefined while it is: the\n * later of `receivingTimeout` of silence (libwebrtc's `Connection::receiving`)\n * and its first unanswered check. libwebrtc needs no unanswered check, as it\n * pings a weak selection every 48 ms; werift checks it far less often.\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/pbt/failoverRules/failoverRulesProperty.test.ts \"a pair is not receiving exactly from the later of the silence and the unanswered check, plus the hold\"\n */\nexport const notReceivingSince = <\n T extends { lastReceived: number; missedSince?: number },\n>(\n pair: T,\n now: number,\n receivingTimeout = WEAK_CONNECTION_RECEIVE_TIMEOUT,\n) => {\n const silentSince = pair.lastReceived + receivingTimeout;\n if (now < silentSince || pair.missedSince === undefined) return undefined;\n return Math.max(silentSince, pair.missedSince);\n};\n\n/**\n * Stopped receiving (libwebrtc's `receiving`, then\n * `receiving_switching_delay`): `notReceivingSince` is\n * `receivingSwitchingDelay` ago, the same time `SelectionController` switches\n * at.\n * @see tests/pbt/failoverRules/failoverRulesProperty.test.ts \"a pair is not receiving exactly from the later of the silence and the unanswered check, plus the hold\"\n * @see tests/ice/selection-controller.test.ts \"an RTT switch within the hold is not a failover: the old pair is not demoted\"\n */\nexport const isNotReceiving = (\n liveness: PairLiveness,\n now: number,\n thresholds: FailoverThresholds = DEFAULT_FAILOVER_THRESHOLDS,\n) => {\n const since = notReceivingSince(liveness, now, thresholds.receivingTimeout);\n return (\n since !== undefined && now - since >= thresholds.receivingSwitchingDelay\n );\n};\n\n/**\n * Interval (ms) to the next check of a backup pair: the weak / stabilizing\n * one until it answered MIN_PINGS_AT_WEAK_PING_INTERVAL times and while its\n * last check goes unanswered, else the stable one (0.8–1.2 times).\n */\nexport const backupPingInterval = (liveness: PairLiveness) =>\n liveness.unanswered > 0 ||\n liveness.responses < MIN_PINGS_AT_WEAK_PING_INTERVAL\n ? WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL\n : STABLE_WRITABLE_CONNECTION_PING_INTERVAL * (0.8 + 0.4 * Math.random());\n\n/**\n * When the next check of a monitored pair is due (ms), given when the last\n * one was sent and the interval it uses while the pair is not weak (D3):\n * - its last check went unanswered (weak), or its path is known to be gone\n * (`broken`): WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL after it;\n * - otherwise `stableInterval` after it, but no later than the moment the\n * pair has received nothing for `receivingTimeout`\n * (WEAK_CONNECTION_RECEIVE_TIMEOUT, weak by silence), and never sooner\n * than the weak interval.\n * Something received later only moves it later: a caller that wakes up at\n * the time computed earlier computes it again.\n */\nexport const nextPingAt = (\n liveness: PairLiveness,\n lastSentAt: number,\n stableInterval: number,\n thresholds: FailoverThresholds = DEFAULT_FAILOVER_THRESHOLDS,\n) => {\n const weakAt =\n lastSentAt + WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL;\n if (liveness.unanswered > 0 || liveness.broken) return weakAt;\n return Math.max(\n weakAt,\n Math.min(\n lastSentAt + stableInterval,\n liveness.lastReceived + thresholds.receivingTimeout,\n ),\n );\n};\n\n/** The agent's side of `FailoverMonitor`. */\nexport interface FailoverHost {\n /**\n * Failover applies now: full ICE on both sides, semi-aggressive nomination\n * or renomination, a selected pair that is not ICE-TCP, an open agent.\n */\n enabled(): boolean;\n selected(): CandidatePair | undefined;\n /** The checklist, highest priority first. */\n pairs(): readonly CandidatePair[];\n /** `pair` may be a backup (not ICE-TCP, checked by the agent). */\n eligible(pair: CandidatePair): boolean;\n iceControlling(): boolean;\n /** The thresholds in use (`IceOptions.failover`). */\n thresholds(): FailoverThresholds;\n /**\n * The agent moves the selection up by itself (controlling, semi-aggressive\n * nomination or renomination): the pairs that outrank the selection are\n * checked and retried there (`SelectionReplacement`).\n */\n movesSelectionUp(): boolean;\n /**\n * Send one check of `pair` without a nomination; resolves true when it\n * was answered. `signal` cancels it.\n */\n ping(pair: CandidatePair, signal: AbortSignal): Promise<boolean>;\n /** A backup that was not valid (Waiting, Frozen, Failed) answered: it is valid now. */\n validated(pair: CandidatePair): void;\n /** A backup was dropped (never answered, or received nothing for DEAD_CONNECTION_RECEIVE_TIMEOUT). */\n dropped(pair: CandidatePair): void;\n /** The writability of a monitored pair may have changed. */\n changed(): void;\n /** A socket the agent failed over from answered FAILOVER_RECOVERY_RESPONSES times in a row. */\n recovered(): void;\n}\n\n/** The backup of one local socket (`Protocol`: a UDP socket or a TURN allocation). */\ntype BackupRecord = {\n pair?: CandidatePair;\n /** When the next check of `pair` is due (see `nextPingAt`; recomputed when it comes). */\n nextAt: number;\n /** When the last check of `pair` was sent. */\n sentAt?: number;\n /** The interval `pair` uses while not weak, fixed when its last check was sent. */\n stableInterval: number;\n /** Checks of `pair` still waiting for their outcome. */\n inFlight: number;\n /** Pairs of this socket that failed as its backup in this round. */\n failed: Set<CandidatePair>;\n /** Rounds started again from the highest-priority pair. */\n retries: number;\n retryTimer?: ReturnType<typeof setTimeout>;\n};\n\n/**\n * Failover of the selected pair without an ICE restart, as libwebrtc keeps\n * pinging its connections after the selection.\n *\n * One backup pair is monitored per local socket other than the selected\n * pair's (`CandidatePair.protocol`: a UDP socket, whose host and\n * server-reflexive candidates share one path, or a TURN allocation): the\n * highest-priority pair of the socket that did not fail. A backup that never\n * answers (unwritable) or receives nothing for DEAD_CONNECTION_RECEIVE_TIMEOUT\n * fails and the next pair of its socket follows, up to\n * FAILOVER_BACKUP_ATTEMPTS pairs; then the socket starts again from its best\n * pair after BACKUP_RETRY_DELAYS_MS, then every 16 s while the selection\n * lasts. All checks run from one timer, paced by\n * Ta, and stop with `halt()` / `reset()`.\n *\n * The selected pair is checked by the consent freshness checks (the agent\n * reports their outcome with `responded` / `unanswered`); the monitor keeps\n * its liveness beside the backups'.\n */\nexport class FailoverMonitor {\n private liveness = new WeakMap<CandidatePair, PairLiveness>();\n private readonly backups = new Map<Protocol, BackupRecord>();\n /** Pairs RFC 8445 §8.1.2 failed without a check: they may still become a backup. */\n private pruned = new WeakSet<CandidatePair>();\n /** Sockets the agent failed over from, until one of their pairs answered FAILOVER_RECOVERY_RESPONSES times in a row. */\n private readonly demoted = new Map<Protocol, DemotedPath>();\n private abort = new AbortController();\n private timer?: ReturnType<typeof setTimeout>;\n private lastSentAt = Number.NEGATIVE_INFINITY;\n private readonly host: FailoverHost;\n\n constructor(host: FailoverHost) {\n this.host = host;\n }\n\n /** The liveness of `pair`, while it is monitored. */\n livenessOf(pair: CandidatePair): PairLiveness | undefined {\n return this.liveness.get(pair);\n }\n\n /** The monitored backup pairs, one per socket. */\n get backupPairs(): CandidatePair[] {\n const pairs: CandidatePair[] = [];\n for (const record of this.backups.values()) {\n if (record.pair) pairs.push(record.pair);\n }\n return pairs;\n }\n\n /** `pair` is monitored and writable. */\n writable(pair: CandidatePair, now = Date.now()) {\n const liveness = this.liveness.get(pair);\n return !!liveness && isWritable(liveness, now, this.host.thresholds());\n }\n\n /** `pair` is monitored, answered since and is unwritable now. */\n knownUnwritable(pair: CandidatePair, now = Date.now()) {\n const liveness = this.liveness.get(pair);\n return (\n !!liveness &&\n liveness.lastResponse !== undefined &&\n isUnwritable(liveness, now, this.host.thresholds())\n );\n }\n\n /** `pair` is monitored and stopped receiving (`isNotReceiving`). */\n notReceiving(pair: CandidatePair, now = Date.now()) {\n const liveness = this.liveness.get(pair);\n return !!liveness && isNotReceiving(liveness, now, this.host.thresholds());\n }\n\n /**\n * The path of the monitored pairs on `protocol` (to `remote` only, when\n * given) is known to be gone (`PairLiveness.broken`). Returns whether a\n * monitored pair was on it.\n */\n broken(protocol: Protocol, remote?: Address) {\n const pairs = new Set(this.backupPairs);\n const selected = this.host.selected();\n if (selected) pairs.add(selected);\n let hit = false;\n for (const pair of pairs) {\n if (pair.protocol !== protocol) continue;\n if (\n remote &&\n (pair.remoteAddr[0] !== remote[0] || pair.remoteAddr[1] !== remote[1])\n ) {\n continue;\n }\n const liveness = this.liveness.get(pair);\n if (!liveness) continue;\n liveness.broken = true;\n liveness.consecutive = 0;\n hit = true;\n }\n return hit;\n }\n\n /** A backup is writable. */\n hasWritableBackup(now = Date.now()) {\n return this.backupPairs.some((pair) => this.writable(pair, now));\n }\n\n /**\n * The backup to fail over to from an unwritable selection: the\n * highest-priority writable one that is not weak, else the\n * highest-priority writable one.\n */\n target(now = Date.now()): CandidatePair | undefined {\n const writable = this.backupPairs.filter((pair) =>\n this.writable(pair, now),\n );\n const best = (pairs: CandidatePair[]) =>\n pairs.reduce<CandidatePair | undefined>(\n (best, pair) => (!best || this.outranks(pair, best) ? pair : best),\n undefined,\n );\n const strong = best(\n writable.filter(\n (pair) =>\n !isWeak(this.liveness.get(pair)!, now, this.host.thresholds()),\n ),\n );\n return strong ?? best(writable);\n }\n\n /**\n * `pair` may be nominated to move the selection up: its socket is not one\n * the agent failed over from (until it recovered) and the pair is not known\n * to be unwritable.\n */\n allows(pair: CandidatePair) {\n return !this.isDemoted(pair) && !this.knownUnwritable(pair);\n }\n\n /** `pair` is on a path the agent failed over from (see `demote`). */\n private isDemoted(pair: CandidatePair) {\n if (!this.demoted.has(pair.protocol)) return false;\n const path = this.demoted.get(pair.protocol);\n return path === undefined || path === remoteKey(pair);\n }\n\n /**\n * `pair` was selected (first selection, or a replacement): its check was\n * just answered. The monitor follows the new selection.\n */\n selected(pair: CandidatePair) {\n if (!this.host.enabled()) return;\n this.track(pair);\n this.responded(pair);\n this.refresh();\n }\n\n /**\n * The agent failed over from `pair` (the new selection is already set):\n * its path waits to recover before the selection may move back. A move to\n * another socket demotes `pair`'s whole socket (its paths break together);\n * a move to another remote address on the same socket demotes only the\n * path to `pair`'s remote address.\n */\n demote(pair: CandidatePair) {\n const selected = this.host.selected();\n const path =\n selected && selected.protocol === pair.protocol\n ? remoteKey(pair)\n : undefined;\n // A whole socket demoted already stays so.\n if (!this.demoted.has(pair.protocol) || this.demoted.get(pair.protocol)) {\n this.demoted.set(pair.protocol, path);\n }\n const liveness = this.liveness.get(pair);\n if (liveness) liveness.consecutive = 0;\n }\n\n /** A check of monitored `pair` was answered. */\n responded(pair: CandidatePair, now = Date.now()) {\n const liveness = this.liveness.get(pair);\n if (!liveness) return;\n liveness.lastResponse = now;\n liveness.lastReceived = now;\n liveness.unanswered = 0;\n liveness.missedSince = undefined;\n liveness.broken = false;\n liveness.responses++;\n liveness.consecutive++;\n }\n\n /** A check of monitored `pair` went unanswered. */\n unanswered(pair: CandidatePair, now = Date.now()) {\n const liveness = this.liveness.get(pair);\n if (!liveness) return;\n if (liveness.unanswered === 0) liveness.missedSince = now;\n liveness.unanswered++;\n liveness.consecutive = 0;\n }\n\n /** Something (a request, application data) arrived on monitored `pair`. */\n received(pair: CandidatePair, now = Date.now()) {\n const liveness = this.liveness.get(pair);\n if (liveness) liveness.lastReceived = now;\n }\n\n /**\n * The pairs RFC 8445 §8.1.2 must keep for the current selection: the\n * backup of each other socket (the monitored one, or the one it would\n * monitor next).\n */\n keeps(): Set<CandidatePair> {\n const keeps = new Set<CandidatePair>();\n const selected = this.host.selected();\n if (!selected || !this.host.enabled()) return keeps;\n for (const protocol of this.backupProtocols(selected)) {\n const record = this.backups.get(protocol);\n const pair = record?.pair ?? this.candidateFor(protocol, record);\n if (pair) keeps.add(pair);\n }\n return keeps;\n }\n\n /** RFC 8445 §8.1.2 failed `pair` without a check: it may still become a backup. */\n prunedWithoutCheck(pair: CandidatePair) {\n this.pruned.add(pair);\n }\n\n /**\n * Bring the backups in line with the selection and the checklist (a new\n * selection, a pair added, a backup that failed) and arm the timer.\n */\n refresh() {\n const selected = this.host.selected();\n if (!selected || !this.host.enabled()) {\n this.halt();\n return;\n }\n const now = Date.now();\n const protocols = this.backupProtocols(selected);\n for (const [protocol, record] of this.backups) {\n if (protocols.has(protocol)) continue;\n this.dropRecord(record);\n this.backups.delete(protocol);\n }\n const pairs = this.host.pairs();\n for (const protocol of protocols) {\n let record = this.backups.get(protocol);\n if (!record) {\n record = {\n nextAt: now,\n stableInterval: 0,\n inFlight: 0,\n failed: new Set(),\n retries: 0,\n };\n this.backups.set(protocol, record);\n }\n // The backup became the selection (or the selection moved to its\n // remote address on this socket): it is released, not failed.\n if (record.pair && !this.backupEligible(record.pair, selected)) {\n if (this.host.eligible(record.pair)) {\n this.replace(record, record.pair);\n }\n }\n const current = record.pair;\n if (\n current &&\n (!pairs.includes(current) ||\n !this.host.eligible(current) ||\n // Failed by another check (a nomination that went unanswered).\n (current.state === CandidatePairState.FAILED &&\n record.inFlight === 0))\n ) {\n this.fail(record, current, false);\n }\n // A higher-priority pair of the socket appeared (a candidate trickled\n // or gathered later): it becomes the backup instead (D2).\n if (record.pair && !record.retryTimer) {\n const best = this.candidateFor(protocol, record);\n if (best && best !== record.pair && this.outranks(best, record.pair)) {\n this.replace(record, record.pair);\n }\n }\n if (record.pair || record.retryTimer) continue;\n const next =\n record.failed.size < FAILOVER_BACKUP_ATTEMPTS\n ? this.candidateFor(protocol, record)\n : undefined;\n if (next) {\n this.adopt(record, next, now);\n } else {\n this.scheduleRetry(protocol, record);\n }\n }\n this.arm();\n }\n\n /** Stop the checks and timers; the liveness of the pairs stays (a role change). */\n halt() {\n this.abort.abort();\n this.abort = new AbortController();\n if (this.timer !== undefined) clearTimeout(this.timer);\n this.timer = undefined;\n for (const record of this.backups.values()) this.dropRecord(record);\n this.backups.clear();\n }\n\n /** Stop everything and forget every pair (restart, close, a selection reset). */\n reset() {\n this.halt();\n this.demoted.clear();\n this.liveness = new WeakMap();\n this.pruned = new WeakSet();\n this.lastSentAt = Number.NEGATIVE_INFINITY;\n }\n\n /**\n * The sockets that keep a backup: every socket of an eligible pair; the\n * selected pair's own socket only through a lower pair to another remote\n * address (the remote side of the selected path may break alone: the\n * peer's host candidate goes away while its relay still answers).\n */\n private backupProtocols(selected: CandidatePair) {\n const protocols = new Set<Protocol>();\n for (const pair of this.host.pairs()) {\n if (!this.backupEligible(pair, selected)) continue;\n protocols.add(pair.protocol);\n }\n return protocols;\n }\n\n /** `pair` may be a backup beside `selected`. */\n private backupEligible(pair: CandidatePair, selected: CandidatePair) {\n if (!this.host.eligible(pair)) return false;\n if (pair.protocol !== selected.protocol) return true;\n // On the selected pair's socket: any other remote address. Only an\n // agent that moves the selection up by itself (controlling) leaves the\n // pairs that outrank the selection to `SelectionReplacement` (checked\n // and retried there), except the path it failed over from (monitored\n // until it recovers, see `demote`). A controlled agent monitors them,\n // so the peer's nomination finds a path known to work.\n if (remoteKey(pair) === remoteKey(selected)) return false;\n return (\n !this.outranks(pair, selected) ||\n this.isDemoted(pair) ||\n !this.host.movesSelectionUp()\n );\n }\n\n /**\n * The next backup of `protocol`: its highest-priority eligible pair that\n * did not fail in this round. A pair a check failed is skipped in the first\n * round (one RFC 8445 §8.1.2 failed unchecked is not); a retry round takes\n * every pair again.\n */\n private candidateFor(protocol: Protocol, record?: BackupRecord) {\n const retrying = (record?.retries ?? 0) > 0;\n const selected = this.host.selected();\n return this.host\n .pairs()\n .find(\n (pair) =>\n pair.protocol === protocol &&\n (selected ? this.backupEligible(pair, selected) : true) &&\n !record?.failed.has(pair) &&\n (pair.state !== CandidatePairState.FAILED ||\n this.pruned.has(pair) ||\n retrying),\n );\n }\n\n private adopt(record: BackupRecord, pair: CandidatePair, now: number) {\n record.pair = pair;\n record.nextAt = now;\n record.sentAt = undefined;\n record.inFlight = 0;\n this.pruned.delete(pair);\n this.track(pair, now);\n // The monitor checks it now: the ordinary schedule and the checks of\n // pairs that outrank the selection (Waiting / Frozen) leave it alone.\n if (pair.state !== CandidatePairState.SUCCEEDED) {\n pair.updateState(CandidatePairState.IN_PROGRESS);\n }\n }\n\n private track(pair: CandidatePair, now = Date.now()) {\n if (this.liveness.has(pair)) return;\n this.liveness.set(pair, {\n since: now,\n lastReceived: now,\n unanswered: 0,\n responses: 0,\n consecutive: 0,\n });\n }\n\n /** `pair` failed as the backup of `record`; with `notify` the agent marks it Failed. */\n private fail(record: BackupRecord, pair: CandidatePair, notify: boolean) {\n record.failed.add(pair);\n record.pair = undefined;\n record.inFlight = 0;\n if (this.host.selected() !== pair) this.liveness.delete(pair);\n if (notify) this.host.dropped(pair);\n }\n\n /**\n * A better pair takes over as the backup of `record`: `pair` is no longer\n * monitored but did not fail. One the monitor was still validating goes\n * back to Failed-without-check, so it may become the backup again.\n */\n private replace(record: BackupRecord, pair: CandidatePair) {\n record.pair = undefined;\n record.inFlight = 0;\n if (this.host.selected() !== pair) this.liveness.delete(pair);\n if (pair.state === CandidatePairState.IN_PROGRESS) {\n pair.updateState(CandidatePairState.FAILED);\n this.pruned.add(pair);\n }\n }\n\n /**\n * The socket's backups all failed: start again from its best pair after\n * BACKUP_RETRY_DELAYS_MS, then every last delay (16 s) for as long as the\n * selection lasts, so a path that comes back after a long outage is found\n * again (and is there when the selected pair breaks).\n */\n private scheduleRetry(protocol: Protocol, record: BackupRecord) {\n if (record.retryTimer) return;\n const delay =\n BACKUP_RETRY_DELAYS_MS[\n Math.min(record.retries, BACKUP_RETRY_DELAYS_MS.length - 1)\n ];\n record.retryTimer = setTimeout(() => {\n record.retryTimer = undefined;\n if (this.backups.get(protocol) !== record) return;\n record.retries++;\n record.failed.clear();\n this.refresh();\n }, delay);\n }\n\n private dropRecord(record: BackupRecord) {\n if (record.retryTimer !== undefined) clearTimeout(record.retryTimer);\n record.retryTimer = undefined;\n record.pair = undefined;\n record.inFlight = 0;\n }\n\n /** One timer for every backup: the earliest check due, Ta after the last one sent. */\n private arm() {\n if (this.timer !== undefined) clearTimeout(this.timer);\n this.timer = undefined;\n let at = Number.POSITIVE_INFINITY;\n for (const record of this.backups.values()) {\n if (record.pair) at = Math.min(at, record.nextAt);\n }\n if (at === Number.POSITIVE_INFINITY) return;\n at = Math.max(at, this.lastSentAt + PACING_MS);\n this.timer = setTimeout(\n () => {\n this.timer = undefined;\n this.tick();\n },\n Math.max(0, at - Date.now()),\n );\n }\n\n private tick() {\n const now = Date.now();\n let due: [Protocol, BackupRecord] | undefined;\n for (const entry of this.backups) {\n const [, record] = entry;\n if (!record.pair || record.nextAt > now) continue;\n // Something received since moves it later (nextPingAt).\n if (record.sentAt !== undefined) {\n const liveness = this.liveness.get(record.pair);\n if (liveness) {\n record.nextAt = nextPingAt(\n liveness,\n record.sentAt,\n record.stableInterval,\n this.host.thresholds(),\n );\n if (record.nextAt > now) continue;\n }\n }\n if (!due || record.nextAt < due[1].nextAt) due = entry;\n }\n if (due) {\n this.lastSentAt = now;\n void this.check(due[0], due[1], due[1].pair!);\n }\n this.arm();\n }\n\n private async check(\n protocol: Protocol,\n record: BackupRecord,\n pair: CandidatePair,\n ) {\n const signal = this.abort.signal;\n const liveness = this.liveness.get(pair)!;\n const sentAt = Date.now();\n // Checks keep their pacing: the next one does not wait for this one's\n // outcome (its response timeout may exceed the interval).\n record.inFlight++;\n record.sentAt = sentAt;\n record.stableInterval = backupPingInterval(liveness);\n const thresholds = this.host.thresholds();\n record.nextAt = nextPingAt(\n liveness,\n sentAt,\n record.stableInterval,\n thresholds,\n );\n let answered = false;\n try {\n answered = await this.host.ping(pair, signal);\n } catch {\n answered = false;\n }\n if (\n signal.aborted ||\n this.backups.get(protocol) !== record ||\n record.pair !== pair\n ) {\n return;\n }\n record.inFlight = Math.max(0, record.inFlight - 1);\n const now = Date.now();\n if (answered) {\n this.responded(pair, now);\n } else {\n this.unanswered(pair);\n }\n // The outcome decides the interval (stabilizing, weak or stable).\n record.stableInterval = backupPingInterval(liveness);\n record.nextAt = Math.max(\n now,\n nextPingAt(liveness, sentAt, record.stableInterval, thresholds),\n );\n\n if (answered && pair.state !== CandidatePairState.SUCCEEDED) {\n this.host.validated(pair);\n }\n if (\n !answered &&\n ((liveness.lastResponse === undefined &&\n isUnwritable(liveness, now, thresholds)) ||\n now - liveness.lastReceived >= DEAD_CONNECTION_RECEIVE_TIMEOUT)\n ) {\n this.fail(record, pair, true);\n this.refresh();\n }\n if (\n answered &&\n this.isDemoted(pair) &&\n liveness.consecutive >= FAILOVER_RECOVERY_RESPONSES\n ) {\n this.demoted.delete(protocol);\n this.host.recovered();\n }\n this.host.changed();\n this.arm();\n }\n\n private outranks(pair: CandidatePair, other: CandidatePair) {\n return (\n compareCandidatePairPriority(\n pair.localCandidate,\n pair.remoteCandidate,\n other.localCandidate,\n other.remoteCandidate,\n this.host.iceControlling(),\n ) > 0\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a gathering reported an error (`Connection.onGatheringError`).
|
|
3
|
+
* New reasons may be added in a minor release: handle unknown values.
|
|
4
|
+
* @enum
|
|
5
|
+
*/
|
|
6
|
+
export declare const IceGatheringErrorReason: {
|
|
7
|
+
/** os.networkInterfaces() threw. @see packages/ice/tests/ice/interface-enumeration.test.ts「without servers or explicit addresses: ends with interface-enumeration-failed then no-candidates」 */
|
|
8
|
+
readonly interfaceEnumerationFailed: "interface-enumeration-failed";
|
|
9
|
+
/** The gathering ended without any local candidate. @see packages/ice/tests/ice/interface-enumeration.test.ts「without servers or explicit addresses: ends with interface-enumeration-failed then no-candidates」 */
|
|
10
|
+
readonly noCandidates: "no-candidates";
|
|
11
|
+
/** gatherCandidates() threw unexpectedly. @see packages/ice/tests/ice/interface-enumeration.test.ts「an unexpected exception reports gathering-failed, ends the generation and rejects」 */
|
|
12
|
+
readonly gatheringFailed: "gathering-failed";
|
|
13
|
+
};
|
|
14
|
+
/** @enum */
|
|
15
|
+
export type IceGatheringErrorReason = (typeof IceGatheringErrorReason)[keyof typeof IceGatheringErrorReason];
|
|
16
|
+
/**
|
|
17
|
+
* A gathering error of one generation (`Connection.onGatheringError`).
|
|
18
|
+
* @see packages/ice/tests/ice/interface-enumeration.test.ts「without servers or explicit addresses: ends with interface-enumeration-failed then no-candidates」
|
|
19
|
+
*/
|
|
20
|
+
export type IceGatheringErrorInfo = {
|
|
21
|
+
reason: IceGatheringErrorReason;
|
|
22
|
+
/** Human-readable description, for logs. Not a stable identifier. */
|
|
23
|
+
errorText: string;
|
|
24
|
+
/** The original exception, when there is one. */
|
|
25
|
+
cause?: unknown;
|
|
26
|
+
/** @see packages/ice/tests/ice/interface-enumeration.test.ts「nothing is reported for a generation an ICE restart replaced」 */
|
|
27
|
+
generation: number;
|
|
28
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IceGatheringErrorReason = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Why a gathering reported an error (`Connection.onGatheringError`).
|
|
6
|
+
* New reasons may be added in a minor release: handle unknown values.
|
|
7
|
+
* @enum
|
|
8
|
+
*/
|
|
9
|
+
exports.IceGatheringErrorReason = {
|
|
10
|
+
/** os.networkInterfaces() threw. @see packages/ice/tests/ice/interface-enumeration.test.ts「without servers or explicit addresses: ends with interface-enumeration-failed then no-candidates」 */
|
|
11
|
+
interfaceEnumerationFailed: "interface-enumeration-failed",
|
|
12
|
+
/** The gathering ended without any local candidate. @see packages/ice/tests/ice/interface-enumeration.test.ts「without servers or explicit addresses: ends with interface-enumeration-failed then no-candidates」 */
|
|
13
|
+
noCandidates: "no-candidates",
|
|
14
|
+
/** gatherCandidates() threw unexpectedly. @see packages/ice/tests/ice/interface-enumeration.test.ts「an unexpected exception reports gathering-failed, ends the generation and rejects」 */
|
|
15
|
+
gatheringFailed: "gathering-failed",
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=gatheringError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gatheringError.js","sourceRoot":"","sources":["../../../../ice/src/gatheringError.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,uBAAuB,GAAG;IACrC,gMAAgM;IAChM,0BAA0B,EAAE,8BAA8B;IAC1D,mNAAmN;IACnN,YAAY,EAAE,eAAe;IAC7B,0LAA0L;IAC1L,eAAe,EAAE,kBAAkB;CAC3B,CAAC","sourcesContent":["/**\n * Why a gathering reported an error (`Connection.onGatheringError`).\n * New reasons may be added in a minor release: handle unknown values.\n * @enum\n */\nexport const IceGatheringErrorReason = {\n /** os.networkInterfaces() threw. @see packages/ice/tests/ice/interface-enumeration.test.ts「without servers or explicit addresses: ends with interface-enumeration-failed then no-candidates」 */\n interfaceEnumerationFailed: \"interface-enumeration-failed\",\n /** The gathering ended without any local candidate. @see packages/ice/tests/ice/interface-enumeration.test.ts「without servers or explicit addresses: ends with interface-enumeration-failed then no-candidates」 */\n noCandidates: \"no-candidates\",\n /** gatherCandidates() threw unexpectedly. @see packages/ice/tests/ice/interface-enumeration.test.ts「an unexpected exception reports gathering-failed, ends the generation and rejects」 */\n gatheringFailed: \"gathering-failed\",\n} as const;\n/** @enum */\nexport type IceGatheringErrorReason =\n (typeof IceGatheringErrorReason)[keyof typeof IceGatheringErrorReason];\n\n/**\n * A gathering error of one generation (`Connection.onGatheringError`).\n * @see packages/ice/tests/ice/interface-enumeration.test.ts「without servers or explicit addresses: ends with interface-enumeration-failed then no-candidates」\n */\nexport type IceGatheringErrorInfo = {\n reason: IceGatheringErrorReason;\n /** Human-readable description, for logs. Not a stable identifier. */\n errorText: string;\n /** The original exception, when there is one. */\n cause?: unknown;\n /** @see packages/ice/tests/ice/interface-enumeration.test.ts「nothing is reported for a generation an ICE restart replaced」 */\n generation: number;\n};\n"]}
|
package/lib/ice/src/ice.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Candidate } from "./candidate";
|
|
2
2
|
import type { IceCandidateErrorInfo, IceServerReachedInfo } from "./candidateError";
|
|
3
3
|
import { MdnsLookup } from "./dns/lookup";
|
|
4
|
+
import { type IceGatheringErrorInfo } from "./gatheringError";
|
|
4
5
|
import { CandidatePair, type IceConnection, type IceOptions, type IceState, type NormalizedTurnServer } from "./iceBase";
|
|
5
6
|
import { type Address, Event } from "./imports/common";
|
|
6
7
|
import { Message } from "./stun/message";
|
|
@@ -20,6 +21,12 @@ export declare class Connection implements IceConnection {
|
|
|
20
21
|
remoteIceOptions: string[];
|
|
21
22
|
remotePassword: string;
|
|
22
23
|
remoteUsername: string;
|
|
24
|
+
/**
|
|
25
|
+
* Remote ufrags of replaced generations (bounded). A late check one of them
|
|
26
|
+
* sends is still answered but never adds a candidate or pair to the new
|
|
27
|
+
* generation's checklist.
|
|
28
|
+
*/
|
|
29
|
+
private retiredRemoteUsernames;
|
|
23
30
|
checkList: CandidatePair[];
|
|
24
31
|
localCandidates: Candidate[];
|
|
25
32
|
/**
|
|
@@ -51,6 +58,12 @@ export declare class Connection implements IceConnection {
|
|
|
51
58
|
private checksBegun;
|
|
52
59
|
/** connect() stopped scheduling checks (a later pair must start its own). */
|
|
53
60
|
private schedulingStopped;
|
|
61
|
+
/**
|
|
62
|
+
* The waits of connect() (one per concurrent call) for the peer's first
|
|
63
|
+
* check on an empty check list; woken when a pair is added or the local
|
|
64
|
+
* gathering ends (waitForIncomingCheck).
|
|
65
|
+
*/
|
|
66
|
+
private readonly incomingCheckWaits;
|
|
54
67
|
generation: number;
|
|
55
68
|
/**
|
|
56
69
|
* Counts every reset of the remote generation: a local ICE restart and a
|
|
@@ -77,6 +90,16 @@ export declare class Connection implements IceConnection {
|
|
|
77
90
|
lookup?: MdnsLookup;
|
|
78
91
|
private _remoteCandidates;
|
|
79
92
|
nominated?: CandidatePair;
|
|
93
|
+
/** Authenticated pair the remote peer last sent application data on. */
|
|
94
|
+
private lastDataPair?;
|
|
95
|
+
/**
|
|
96
|
+
* Selected pairs of the previous generation (ours and the one the peer was
|
|
97
|
+
* sending on; nomination can be asymmetric). RFC 8445 §9: media continues
|
|
98
|
+
* over the previously selected pair until the restart selects a new one.
|
|
99
|
+
* The peer may keep using it after we nominate, so these are released once
|
|
100
|
+
* the peer sends on an authenticated current-generation pair.
|
|
101
|
+
*/
|
|
102
|
+
private previousSelectedPairs;
|
|
80
103
|
/** The ICE-lite nomination (first valid pair, in `checkStart`) is in flight. */
|
|
81
104
|
private liteNominating;
|
|
82
105
|
/** Regular nomination (RFC 8445 §8.1.1) of the live checklist. */
|
|
@@ -119,17 +142,12 @@ export declare class Connection implements IceConnection {
|
|
|
119
142
|
*/
|
|
120
143
|
private remoteChecks;
|
|
121
144
|
private checkListDone;
|
|
122
|
-
/** Resolves when the agent closes: work that awaits the network stops waiting. */
|
|
123
|
-
private readonly closedSignal;
|
|
124
|
-
private signalClosed;
|
|
125
145
|
/** Aborted by close(): a TURN allocation still running is released. */
|
|
126
146
|
private readonly closing;
|
|
127
147
|
/**
|
|
128
|
-
* Results for connect()
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* the caller (webrtc's `TransactionActivation`) treats a returned start as
|
|
132
|
-
* a connected ICE transport.
|
|
148
|
+
* Results for connect() of the current generation. A restart replaces the
|
|
149
|
+
* queue; a connect() of the replaced generation keeps the old one and
|
|
150
|
+
* stops on that generation's `remoteChecks` signal instead (connectError).
|
|
133
151
|
*/
|
|
134
152
|
private checkListState;
|
|
135
153
|
private earlyChecks;
|
|
@@ -138,6 +156,39 @@ export declare class Connection implements IceConnection {
|
|
|
138
156
|
private protocols;
|
|
139
157
|
/** RFC 7675 consent freshness of the selected pair. */
|
|
140
158
|
private readonly consent;
|
|
159
|
+
/**
|
|
160
|
+
* Failover of the selected pair without an ICE restart (see
|
|
161
|
+
* `failoverEnabled`): the backup pairs it monitors and the liveness of
|
|
162
|
+
* the selected one.
|
|
163
|
+
*/
|
|
164
|
+
private readonly failover;
|
|
165
|
+
/**
|
|
166
|
+
* The pair a nomination that moves the selection off a pair that still
|
|
167
|
+
* outranks (or equals) it is sent for, until its outcome, and why
|
|
168
|
+
* (`failover`: `evaluateFailover`; `receiving`, `rtt`:
|
|
169
|
+
* `SelectionController`). When it succeeds the selection moves to it even
|
|
170
|
+
* if the old pair answered again meanwhile (the peer may already have taken
|
|
171
|
+
* the nomination). After `failover` and `receiving` the old pair's socket
|
|
172
|
+
* is demoted (D4).
|
|
173
|
+
* @see tests/ice/selection-controller.test.ts "receiving: a selection that recovers within RECEIVING_SWITCHING_DELAY stays; one that does not moves after it"
|
|
174
|
+
* @see tests/ice/selection-controller.test.ts "an RTT switch within the hold is not a failover: the old pair is not demoted"
|
|
175
|
+
*/
|
|
176
|
+
private switchNomination?;
|
|
177
|
+
/**
|
|
178
|
+
* The controlling agent's choice among the selection and the monitored
|
|
179
|
+
* backups by receiving state and RTT (libwebrtc's ICE controller).
|
|
180
|
+
*/
|
|
181
|
+
private readonly switching;
|
|
182
|
+
/** See `failoverThresholds`. */
|
|
183
|
+
private failoverThresholdsCache?;
|
|
184
|
+
/**
|
|
185
|
+
* The selected pair's consent expired while a backup was writable: the
|
|
186
|
+
* agent fails when this fires unless the selection moved first
|
|
187
|
+
* (FAILOVER_CONSENT_EXPIRED_GRACE).
|
|
188
|
+
*/
|
|
189
|
+
private consentExpiredGrace?;
|
|
190
|
+
/** The state `disconnected` replaced, restored when the selection works again. */
|
|
191
|
+
private stateBeforeDisconnect?;
|
|
141
192
|
/** Host, server-reflexive and relay gathering (`CandidateGatherer`). */
|
|
142
193
|
private readonly gatherer;
|
|
143
194
|
/**
|
|
@@ -168,6 +219,19 @@ export declare class Connection implements IceConnection {
|
|
|
168
219
|
* synthesized URL {@link DEFAULT_STUN_SERVER_URL} in `server.urls`.
|
|
169
220
|
*/
|
|
170
221
|
readonly onIceCandidateError: Event<[IceCandidateErrorInfo]>;
|
|
222
|
+
/**
|
|
223
|
+
* The current generation's gathering reported an error (werift extension,
|
|
224
|
+
* see {@link IceGatheringErrorInfo}). New reasons may be added: handle
|
|
225
|
+
* unknown values.
|
|
226
|
+
* @see packages/ice/tests/ice/interface-enumeration.test.ts「without servers or explicit addresses: ends with interface-enumeration-failed then no-candidates」
|
|
227
|
+
* @see packages/ice/tests/ice/interface-enumeration.test.ts「a STUN server still gives a server-reflexive candidate」
|
|
228
|
+
* @see packages/ice/tests/ice/interface-enumeration.test.ts「an unexpected exception reports gathering-failed, ends the generation and rejects」
|
|
229
|
+
* @see packages/ice/tests/ice/interface-enumeration.test.ts「restarting from the no-candidates listener leaves the new generation ungathered」
|
|
230
|
+
* @see packages/ice/tests/ice/interface-enumeration.test.ts「nothing is reported after close」
|
|
231
|
+
* @see packages/ice/tests/ice/interface-enumeration.test.ts「nothing is reported for a generation an ICE restart replaced」
|
|
232
|
+
* @see packages/ice/tests/ice/interface-enumeration.test.ts「a listener that throws does not stop the gathering or the later listeners」
|
|
233
|
+
*/
|
|
234
|
+
readonly onGatheringError: Event<[IceGatheringErrorInfo]>;
|
|
171
235
|
/**
|
|
172
236
|
* A STUN or TURN server of the current generation's gathering answered:
|
|
173
237
|
* a STUN query or TURN allocation gave a candidate, or the server sent an
|
|
@@ -177,6 +241,12 @@ export declare class Connection implements IceConnection {
|
|
|
177
241
|
readonly onIceServerReached: Event<[IceServerReachedInfo]>;
|
|
178
242
|
/** The staged ICE restart generation (`ProvisionalChecklist`). */
|
|
179
243
|
private get provisional();
|
|
244
|
+
private set spedRuntime(value);
|
|
245
|
+
/**
|
|
246
|
+
* Exact SPED Binding Response bytes keyed by STUN transaction id.
|
|
247
|
+
* Handshake only: TTL = STUN transaction lifetime, LRU-capped.
|
|
248
|
+
*/
|
|
249
|
+
private spedBindingCache;
|
|
180
250
|
constructor(_iceControlling: boolean, options?: Partial<IceOptions>);
|
|
181
251
|
/**
|
|
182
252
|
* Replace STUN/TURN servers after construction.
|
|
@@ -209,7 +279,35 @@ export declare class Connection implements IceConnection {
|
|
|
209
279
|
get iceControlling(): boolean;
|
|
210
280
|
set iceControlling(value: boolean);
|
|
211
281
|
get iceLite(): boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Keep the selected path of the generation a restart replaces: the peer
|
|
284
|
+
* keeps sending media on it until it moves to the new selected pair
|
|
285
|
+
* (RFC 8445 §9). Its datagrams stay deliverable as media only.
|
|
286
|
+
*/
|
|
287
|
+
private retainSelectedPairs;
|
|
212
288
|
restart(): Promise<void>;
|
|
289
|
+
/** DTLS handshake datagram on an authenticated current-generation pair. */
|
|
290
|
+
private sendHandshakeOnAuthenticatedPair;
|
|
291
|
+
/**
|
|
292
|
+
* Direct fallback only on a current-generation authenticated CandidatePair.
|
|
293
|
+
* No pair (e.g. earlyChecks) means no wire send.
|
|
294
|
+
*/
|
|
295
|
+
private maybeSendSpedFallback;
|
|
296
|
+
/**
|
|
297
|
+
* UDP prflx with a pending C070-less Binding: lock unsupported once
|
|
298
|
+
* trickle proves host/srflx, or end-of-candidates / nomination leaves a
|
|
299
|
+
* lasting prflx. Nomination is enough: RFC 8838 allows ICE to complete
|
|
300
|
+
* before end-of-candidates, and a nominated pair must not gain new
|
|
301
|
+
* trickle candidates.
|
|
302
|
+
* @returns the pair that locked unsupported, if any.
|
|
303
|
+
*/
|
|
304
|
+
private settleSpedUnconfirmed;
|
|
305
|
+
/**
|
|
306
|
+
* Send the original L1 snapshot on the pair that locked fallback.
|
|
307
|
+
* Prefer `preferredPair` so nomination settlement cannot race
|
|
308
|
+
* `this.nominated` and land on an earlier authenticated checklist entry.
|
|
309
|
+
*/
|
|
310
|
+
private flushSpedUnconfirmedFallback;
|
|
213
311
|
/**
|
|
214
312
|
* Only the remote side restarted (new remote credentials in an answer to an
|
|
215
313
|
* offer that kept the local ones): the remote generation, its checks and
|
|
@@ -249,6 +347,9 @@ export declare class Connection implements IceConnection {
|
|
|
249
347
|
usernameFragment: string;
|
|
250
348
|
password: string;
|
|
251
349
|
}): void;
|
|
350
|
+
private retireRemoteUsername;
|
|
351
|
+
/** A check sent by a remote generation that was replaced. */
|
|
352
|
+
private isRetiredRemoteCheck;
|
|
252
353
|
/**
|
|
253
354
|
* Gather the local candidates of the current generation.
|
|
254
355
|
*
|
|
@@ -259,6 +360,19 @@ export declare class Connection implements IceConnection {
|
|
|
259
360
|
* allocation), so a caller may let it finish in the background.
|
|
260
361
|
*/
|
|
261
362
|
gatherCandidates(): Promise<void>;
|
|
363
|
+
/** @see packages/ice/tests/ice/interface-enumeration.test.ts「an unexpected exception reports gathering-failed, ends the generation and rejects」 */
|
|
364
|
+
private gatherGeneration;
|
|
365
|
+
/** @see packages/ice/tests/ice/interface-enumeration.test.ts「without servers or explicit addresses: ends with interface-enumeration-failed then no-candidates」 */
|
|
366
|
+
private endLocalCandidates;
|
|
367
|
+
/** @see packages/ice/tests/ice/interface-enumeration.test.ts「nothing is reported after close」 */
|
|
368
|
+
private emitGatheringError;
|
|
369
|
+
/**
|
|
370
|
+
* Wait for `work` or close(), whichever comes first. Unlike racing a
|
|
371
|
+
* promise that stays pending for the agent's lifetime, the close listener
|
|
372
|
+
* goes away with this wait, so a settled gathering (and the candidates its
|
|
373
|
+
* result holds) is not kept alive by every later restart.
|
|
374
|
+
*/
|
|
375
|
+
private untilSettledOrClosed;
|
|
262
376
|
/**
|
|
263
377
|
* Resolves when the current generation's gathering has ended
|
|
264
378
|
* (`localCandidatesEnd`): {@link Connection.gatherCandidates} returns once
|
|
@@ -288,6 +402,18 @@ export declare class Connection implements IceConnection {
|
|
|
288
402
|
/** Report that `server` answered the gathering whose `stale` is given. */
|
|
289
403
|
private emitServerReached;
|
|
290
404
|
private ensureProtocol;
|
|
405
|
+
private handleBindingRequest;
|
|
406
|
+
/** Queue a check until connect() while the checklist is empty, else handle it. */
|
|
407
|
+
private queueOrCheckIncoming;
|
|
408
|
+
/**
|
|
409
|
+
* @returns true when the request is fully handled (an error response was
|
|
410
|
+
* sent, or the role switched and the peer retries).
|
|
411
|
+
*/
|
|
412
|
+
private resolveRoleConflict;
|
|
413
|
+
private handleCurrentGenerationBinding;
|
|
414
|
+
private shouldCacheSpedBindingResponse;
|
|
415
|
+
private cachedSpedBindingResponse;
|
|
416
|
+
private storeSpedBindingResponse;
|
|
291
417
|
/**
|
|
292
418
|
* RFC 6544: the selected TCP connection is the only path for this component;
|
|
293
419
|
* once it is closed no application data or consent check can reach the peer,
|
|
@@ -295,6 +421,35 @@ export declare class Connection implements IceConnection {
|
|
|
295
421
|
*/
|
|
296
422
|
private handleConnectionClosed;
|
|
297
423
|
connect(): Promise<void>;
|
|
424
|
+
/**
|
|
425
|
+
* The error connect() ends with when its generation ended: close() fails
|
|
426
|
+
* it as before (`ICE negotiation failed`); a restart (local or
|
|
427
|
+
* remote-only) cancels it with `IceRestartedError`, which says nothing
|
|
428
|
+
* about the generation that replaced it.
|
|
429
|
+
*/
|
|
430
|
+
private connectError;
|
|
431
|
+
/**
|
|
432
|
+
* Resolves (with ICE_FAILED, which no caller acts on: each checks
|
|
433
|
+
* `ended` first) once `ended` aborts, so a wait raced against it stops.
|
|
434
|
+
*/
|
|
435
|
+
private untilEnded;
|
|
436
|
+
/**
|
|
437
|
+
* With an empty check list, wait for a pair (a check from the peer taught a
|
|
438
|
+
* peer-reflexive candidate, RFC 8445 section 7.3.1.3, the only way to
|
|
439
|
+
* connect to a peer whose TCP candidates are all active, RFC 6544; or a
|
|
440
|
+
* trickled candidate). Resolves true when a pair was added, so that the
|
|
441
|
+
* scheduling loop runs again; false when:
|
|
442
|
+
* - the local gathering ended without a socket that could receive a check
|
|
443
|
+
* (at once, also when it ends during the wait: an ICE-lite agent may
|
|
444
|
+
* connect while it still gathers),
|
|
445
|
+
* - `incomingCheckTimeout` ran out (a deadline fixed when the wait began;
|
|
446
|
+
* being woken does not extend it), or
|
|
447
|
+
* - the generation ended (`ended`; the caller settles with connectError).
|
|
448
|
+
* Every concurrent caller wakes on its own.
|
|
449
|
+
*/
|
|
450
|
+
private waitForIncomingCheck;
|
|
451
|
+
/** Wake every wait of connect() for an incoming check (waitForIncomingCheck). */
|
|
452
|
+
private wakeIncomingCheckWaits;
|
|
298
453
|
private unfreezeInitial;
|
|
299
454
|
private schedulingChecks;
|
|
300
455
|
/**
|
|
@@ -312,7 +467,9 @@ export declare class Connection implements IceConnection {
|
|
|
312
467
|
* agent was controlled) takes the next value.
|
|
313
468
|
*/
|
|
314
469
|
private consentNomination;
|
|
315
|
-
private
|
|
470
|
+
private applicationDataPair;
|
|
471
|
+
/** Start RFC 7675 consent freshness for the selected pair. */
|
|
472
|
+
private queryConsent;
|
|
316
473
|
close(): Promise<void>;
|
|
317
474
|
private setState;
|
|
318
475
|
/**
|
|
@@ -324,6 +481,11 @@ export declare class Connection implements IceConnection {
|
|
|
324
481
|
* the pairing and provisional lifecycle together.
|
|
325
482
|
*/
|
|
326
483
|
addRemoteCandidate(remoteCandidate: Candidate | undefined): Promise<void>;
|
|
484
|
+
/**
|
|
485
|
+
* Trickle may signal host/srflx/relay after the address was learned as
|
|
486
|
+
* prflx. Reuse that Candidate so SPED eligibility follows the signaled type.
|
|
487
|
+
*/
|
|
488
|
+
private adoptExistingPrflx;
|
|
327
489
|
send: (data: Buffer) => Promise<void>;
|
|
328
490
|
getDefaultCandidate(): Candidate;
|
|
329
491
|
set remoteCandidates(value: Candidate[]);
|
|
@@ -331,6 +493,24 @@ export declare class Connection implements IceConnection {
|
|
|
331
493
|
get candidatePairs(): CandidatePair[];
|
|
332
494
|
private sortCheckList;
|
|
333
495
|
private findPair;
|
|
496
|
+
/**
|
|
497
|
+
* Several remote candidates can share one transport address (a srflx equal
|
|
498
|
+
* to its host base), so one 5-tuple may have several pairs. Checks are
|
|
499
|
+
* accounted on one of them only; prefer the authenticated pair so the
|
|
500
|
+
* 5-tuple is not judged by a FROZEN/FAILED duplicate.
|
|
501
|
+
*/
|
|
502
|
+
private findPairByAddr;
|
|
503
|
+
/**
|
|
504
|
+
* Datagrams map to a pair by protocol and remote 5-tuple.
|
|
505
|
+
* Nominated is preferred only when the source matches that pair.
|
|
506
|
+
*/
|
|
507
|
+
private resolveDatagramPair;
|
|
508
|
+
private isPreviousSelectedPair;
|
|
509
|
+
private decorateSpedRequest;
|
|
510
|
+
private bindingResponseSourceMatches;
|
|
511
|
+
private isStaleConnectivityCheck;
|
|
512
|
+
private abandonInFlightStunTransactions;
|
|
513
|
+
private consumeSpedStun;
|
|
334
514
|
private applyIceControlling;
|
|
335
515
|
/**
|
|
336
516
|
* The agent became controlling with a pair already selected (live or
|
|
@@ -462,6 +642,7 @@ export declare class Connection implements IceConnection {
|
|
|
462
642
|
/** The agent was closed or restarted while the ICE-lite nomination was in flight. */
|
|
463
643
|
private isStaleNomination;
|
|
464
644
|
private addPair;
|
|
645
|
+
private ensureIncomingPair;
|
|
465
646
|
checkIncoming(message: Message, addr: Address, protocol: Protocol): void;
|
|
466
647
|
/**
|
|
467
648
|
* @param admit after a selection that may still be replaced, only pairs
|
|
@@ -470,6 +651,81 @@ export declare class Connection implements IceConnection {
|
|
|
470
651
|
private tryPair;
|
|
471
652
|
/** See `tryPair`: undefined admits every pair. */
|
|
472
653
|
private admitsPair;
|
|
654
|
+
/**
|
|
655
|
+
* Failover of the selected pair without an ICE restart (libwebrtc
|
|
656
|
+
* compatible) applies to the agent's mode: both agents are full ICE and the
|
|
657
|
+
* agent uses semi-aggressive nomination or renomination (the modes in which
|
|
658
|
+
* a controlling agent may replace the selection, `replacesSelection`; a
|
|
659
|
+
* controlled agent follows the peer's nominations). Regular nomination
|
|
660
|
+
* (RFC 8445 §8.1.1 allows no other pair without an ICE restart) and ICE-lite
|
|
661
|
+
* keep the selection until consent expires.
|
|
662
|
+
*/
|
|
663
|
+
private failoverScope;
|
|
664
|
+
/** {@link failoverScope}, and the selected pair is not ICE-TCP (its closed connection fails the agent). */
|
|
665
|
+
private failoverEnabled;
|
|
666
|
+
/** `IceOptions.failover` with its defaults (resolved again when the options change). */
|
|
667
|
+
private get failoverThresholds();
|
|
668
|
+
/**
|
|
669
|
+
* Failover: the selected pair stopped receiving (`isNotReceiving`) while
|
|
670
|
+
* its consent is still fresh and it is not unwritable yet.
|
|
671
|
+
* `SelectionController` makes that switch; this lets its nomination
|
|
672
|
+
* replace the selection.
|
|
673
|
+
* @see tests/ice/failover.test.ts "the selected pair stops answering and receiving: once it has not been receiving for 1 s (from the later of 2.5 s of silence and an unanswered check), the agent moves to the backup that receives, before the pair is unwritable (§15 A)"
|
|
674
|
+
*/
|
|
675
|
+
private selectionNotReceiving;
|
|
676
|
+
/** Failover: the selection may move to a backup ({@link selectionDown} or {@link selectionNotReceiving}). */
|
|
677
|
+
private selectionFailing;
|
|
678
|
+
/** Failover: the selected pair stopped answering (unwritable) or its consent expired. */
|
|
679
|
+
private selectionDown;
|
|
680
|
+
/** Whether `pair` may be nominated to move the selection up (see `FailoverMonitor.allows`). */
|
|
681
|
+
private failoverAllows;
|
|
682
|
+
private failoverHost;
|
|
683
|
+
/** The writability of a monitored pair may have changed. */
|
|
684
|
+
private onLinkChanged;
|
|
685
|
+
/**
|
|
686
|
+
* Failover (controlling): the selected pair stopped answering, so nominate
|
|
687
|
+
* the best writable backup (`FailoverMonitor.target`), with USE-CANDIDATE
|
|
688
|
+
* (semi-aggressive) or the next NOMINATION value (renomination). Its
|
|
689
|
+
* success moves the selection (`replacesSelectedPair`). A controlled agent
|
|
690
|
+
* only follows the peer's nominations.
|
|
691
|
+
*
|
|
692
|
+
* A selected pair that only stopped receiving is `SelectionController`'s.
|
|
693
|
+
* @see tests/ice/failover.test.ts "the selected pair stops answering and receiving: once it has not been receiving for 1 s (from the later of 2.5 s of silence and an unanswered check), the agent moves to the backup that receives, before the pair is unwritable (§15 A)"
|
|
694
|
+
*/
|
|
695
|
+
private evaluateFailover;
|
|
696
|
+
/**
|
|
697
|
+
* Failover: the agent's state from the selected pair and the backups.
|
|
698
|
+
* `disconnected` while the selected pair is unwritable and no backup is
|
|
699
|
+
* writable; back to the state it replaced only once the selected pair is
|
|
700
|
+
* writable again (it recovered, or the selection moved to a backup); a
|
|
701
|
+
* backup that answers before the selection moved to it keeps the agent
|
|
702
|
+
* `disconnected`. `failed` once the selected pair's consent expired with no
|
|
703
|
+
* writable backup left.
|
|
704
|
+
*/
|
|
705
|
+
private updateLinkState;
|
|
706
|
+
/** See `consentExpiredGrace`. */
|
|
707
|
+
private startConsentExpiredGrace;
|
|
708
|
+
private clearConsentExpiredGrace;
|
|
709
|
+
/** The selected pair's consent expired and no backup took over: the agent fails (an ICE restart recovers). */
|
|
710
|
+
private failConsentExpired;
|
|
711
|
+
/**
|
|
712
|
+
* Failover: sending on `protocol` (to `remoteAddr`, or on every path of it
|
|
713
|
+
* when undefined: its TURN allocation is lost) failed in a way that says
|
|
714
|
+
* the path is gone (`Protocol.onPathBroken`). The monitored pairs on it are
|
|
715
|
+
* unwritable at once, so the selection fails over without waiting for
|
|
716
|
+
* unanswered checks (libwebrtc drops the connections of a port that is
|
|
717
|
+
* gone).
|
|
718
|
+
*/
|
|
719
|
+
private failoverPathBroken;
|
|
720
|
+
/** Failover: application data arrived on `protocol` from `addr`. */
|
|
721
|
+
private failoverDataReceived;
|
|
722
|
+
/**
|
|
723
|
+
* Failover: one check of a backup pair, as libwebrtc pings its
|
|
724
|
+
* connections: no nomination (USE-CANDIDATE / NOMINATION only when the
|
|
725
|
+
* selection moves to it), a single transmission with the consent response
|
|
726
|
+
* timeout. Resolves true when it was answered from the pair's address.
|
|
727
|
+
*/
|
|
728
|
+
private pingBackup;
|
|
473
729
|
/**
|
|
474
730
|
* Pair a local candidate gathered after remote candidates arrived (a late
|
|
475
731
|
* TURN allocation, a slow host socket) with them.
|