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
package/lib/ice/src/ice.d.ts
CHANGED
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
import { Candidate } from "./candidate";
|
|
2
|
+
import type { IceCandidateErrorInfo, IceServerReachedInfo } from "./candidateError";
|
|
2
3
|
import { MdnsLookup } from "./dns/lookup";
|
|
3
|
-
import {
|
|
4
|
+
import { type IceGatheringErrorInfo } from "./gatheringError";
|
|
5
|
+
import { CandidatePair, type IceConnection, type IceOptions, type IceState, type NormalizedTurnServer } from "./iceBase";
|
|
4
6
|
import { type Address, Event } from "./imports/common";
|
|
5
7
|
import { Message } from "./stun/message";
|
|
6
8
|
import type { Protocol } from "./types/model";
|
|
9
|
+
/**
|
|
10
|
+
* The URL `onIceCandidateError` names the built-in default STUN server by:
|
|
11
|
+
* it is in no configuration, so werift synthesizes one.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DEFAULT_STUN_SERVER_URL = "stun:stun.l.google.com:19302";
|
|
7
14
|
export declare class Connection implements IceConnection {
|
|
8
15
|
private _iceControlling;
|
|
9
16
|
localUsername: string;
|
|
10
17
|
localPassword: string;
|
|
11
18
|
remoteIsLite: boolean;
|
|
19
|
+
/** The peer advertised `a=ice-options:renomination` (see `IceOptions.renomination`). */
|
|
20
|
+
remoteRenomination: boolean;
|
|
21
|
+
remoteIceOptions: string[];
|
|
12
22
|
remotePassword: string;
|
|
13
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;
|
|
14
30
|
checkList: CandidatePair[];
|
|
15
31
|
localCandidates: Candidate[];
|
|
16
32
|
/**
|
|
@@ -19,8 +35,10 @@ export declare class Connection implements IceConnection {
|
|
|
19
35
|
* configured and useDefaultStunServer is not false.
|
|
20
36
|
*/
|
|
21
37
|
stunServers: Address[];
|
|
38
|
+
/** Whether stunServers is the built-in default (none configured). */
|
|
39
|
+
private usesDefaultStunServer;
|
|
22
40
|
/** TURN servers gathering allocates on, one allocation each. */
|
|
23
|
-
turnServers:
|
|
41
|
+
turnServers: NormalizedTurnServer[];
|
|
24
42
|
options: IceOptions;
|
|
25
43
|
remoteCandidatesEnd: boolean;
|
|
26
44
|
/**
|
|
@@ -38,6 +56,14 @@ export declare class Connection implements IceConnection {
|
|
|
38
56
|
localCandidatesEnd: boolean;
|
|
39
57
|
/** connect() began this generation's checks (their outcome sets the state). */
|
|
40
58
|
private checksBegun;
|
|
59
|
+
/** connect() stopped scheduling checks (a later pair must start its own). */
|
|
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;
|
|
41
67
|
generation: number;
|
|
42
68
|
/**
|
|
43
69
|
* Counts every reset of the remote generation: a local ICE restart and a
|
|
@@ -64,7 +90,26 @@ export declare class Connection implements IceConnection {
|
|
|
64
90
|
lookup?: MdnsLookup;
|
|
65
91
|
private _remoteCandidates;
|
|
66
92
|
nominated?: CandidatePair;
|
|
67
|
-
|
|
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;
|
|
103
|
+
/** The ICE-lite nomination (first valid pair, in `checkStart`) is in flight. */
|
|
104
|
+
private liteNominating;
|
|
105
|
+
/** Regular nomination (RFC 8445 §8.1.1) of the live checklist. */
|
|
106
|
+
private readonly nomination;
|
|
107
|
+
/** Semi-aggressive nomination and renomination: replacing the selection. */
|
|
108
|
+
private readonly selection;
|
|
109
|
+
/** See `NominationHint`; set by the restart that ends a provisional checklist. */
|
|
110
|
+
private nominationHint?;
|
|
111
|
+
/** USE-CANDIDATE re-sent for a pair selected before the agent became controlling (`confirmSelections`). */
|
|
112
|
+
private readonly selectionConfirmations;
|
|
68
113
|
/**
|
|
69
114
|
* Aborted when the remote generation ends (restart, restartRemote, close):
|
|
70
115
|
* every check and nomination transaction of that generation stops with it.
|
|
@@ -77,55 +122,131 @@ export declare class Connection implements IceConnection {
|
|
|
77
122
|
* - `retryCheck` (487 role conflict / 401 retry): the handle of the check
|
|
78
123
|
* it replaces and this signal (the retry is a `checkStart`).
|
|
79
124
|
* - regular nomination in `checkStart` (toward an ICE-lite peer): the
|
|
80
|
-
* check's signal; `isStaleNomination` guards `
|
|
81
|
-
* and `checkComplete`.
|
|
82
|
-
* - `
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* `
|
|
125
|
+
* check's signal; `isStaleNomination` guards `liteNominating`, the pair
|
|
126
|
+
* state and `checkComplete`.
|
|
127
|
+
* - `RegularNomination` (live: `sendNomination`): this signal and the
|
|
128
|
+
* attempt's own, which `reset()` (restart, restartRemote,
|
|
129
|
+
* resetNominatedPair, close) and `invalidate()` (role change) abort; a
|
|
130
|
+
* result of a replaced attempt is ignored. Its delay timer is cleared by
|
|
131
|
+
* `reset()`.
|
|
132
|
+
* - `ProvisionalChecklist` checks and nominations: `generation.checks`
|
|
133
|
+
* (`end()`, a replacement pranswer, close); `belongs()`, and
|
|
134
|
+
* the provisional `RegularNomination` as above.
|
|
135
|
+
* - consent checks (`ConsentFreshness`): a per-request `AbortController`
|
|
136
|
+
* and `consent.stop()`; its session id.
|
|
87
137
|
* - `serverReflexiveCandidate` (gathering): `protocol.close()`; otherwise
|
|
88
138
|
* it ends by its retransmission timeout, and `stale()` drops the
|
|
89
|
-
* candidate of an ended gather.
|
|
139
|
+
* candidate (or the failure) of an ended gather.
|
|
90
140
|
* - TURN client requests: the `closing` signal and `TurnProtocol.close()`.
|
|
91
141
|
* Regression tests: `tests/ice/check-cancel.test.ts`.
|
|
92
142
|
*/
|
|
93
143
|
private remoteChecks;
|
|
94
144
|
private checkListDone;
|
|
95
|
-
/** Resolves when the agent closes: work that awaits the network stops waiting. */
|
|
96
|
-
private readonly closedSignal;
|
|
97
|
-
private signalClosed;
|
|
98
145
|
/** Aborted by close(): a TURN allocation still running is released. */
|
|
99
146
|
private readonly closing;
|
|
100
147
|
/**
|
|
101
|
-
* Results for connect()
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* the caller (webrtc's `TransactionActivation`) treats a returned start as
|
|
105
|
-
* 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).
|
|
106
151
|
*/
|
|
107
152
|
private checkListState;
|
|
108
153
|
private earlyChecks;
|
|
109
154
|
private earlyChecksDone;
|
|
110
155
|
private localCandidatesStart;
|
|
111
156
|
private protocols;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
157
|
+
/** RFC 7675 consent freshness of the selected pair. */
|
|
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?;
|
|
121
184
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
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).
|
|
124
188
|
*/
|
|
125
|
-
private
|
|
189
|
+
private consentExpiredGrace?;
|
|
190
|
+
/** The state `disconnected` replaced, restored when the selection works again. */
|
|
191
|
+
private stateBeforeDisconnect?;
|
|
192
|
+
/** Host, server-reflexive and relay gathering (`CandidateGatherer`). */
|
|
193
|
+
private readonly gatherer;
|
|
194
|
+
/**
|
|
195
|
+
* Settles when the background server-reflexive queries of the current
|
|
196
|
+
* generation end (see {@link Connection.waitForLocalCandidatesEnd}).
|
|
197
|
+
*/
|
|
198
|
+
private localCandidatesEndPromise?;
|
|
199
|
+
/** ICE restart generation checked beside the selected current pair. */
|
|
200
|
+
private readonly provisionalChecklist;
|
|
126
201
|
readonly onData: Event<[Buffer<ArrayBufferLike>]>;
|
|
127
202
|
readonly stateChanged: Event<[IceState]>;
|
|
128
203
|
readonly onIceCandidate: Event<[Candidate]>;
|
|
204
|
+
/**
|
|
205
|
+
* A STUN server query or TURN allocation of the current generation's
|
|
206
|
+
* gathering failed (W3C `icecandidateerror`), synchronously and without
|
|
207
|
+
* changing the gathering: other servers and sockets go on, and gathering
|
|
208
|
+
* still completes. A server answering with an error gives its ERROR-CODE,
|
|
209
|
+
* once per local socket and generation. One that is not reached (timeout,
|
|
210
|
+
* `stunGatherTimeout`, DNS, connect or socket error) gives 701, once per
|
|
211
|
+
* server and generation and only when no local socket reached it (a STUN
|
|
212
|
+
* server is reported when the last socket's query ended). A TURN server's UDP attempt and its TCP fallback are
|
|
213
|
+
* one failure, reported when both failed (a server's error code wins over
|
|
214
|
+
* 701). A credential retry (401 / 438) that succeeds is not a failure.
|
|
215
|
+
* Nothing is fired for a replaced generation or after close (the event
|
|
216
|
+
* completes then). A STUN failure carries the host address of a socket
|
|
217
|
+
* that asked; a TURN one carries none. The built-in default STUN server (none
|
|
218
|
+
* configured, `useDefaultStunServer` not false) is named by the
|
|
219
|
+
* synthesized URL {@link DEFAULT_STUN_SERVER_URL} in `server.urls`.
|
|
220
|
+
*/
|
|
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]>;
|
|
235
|
+
/**
|
|
236
|
+
* A STUN or TURN server of the current generation's gathering answered:
|
|
237
|
+
* a STUN query or TURN allocation gave a candidate, or the server sent an
|
|
238
|
+
* error response (see {@link IceServerReachedInfo}). Synchronous; nothing
|
|
239
|
+
* is fired for a replaced generation or after close.
|
|
240
|
+
*/
|
|
241
|
+
readonly onIceServerReached: Event<[IceServerReachedInfo]>;
|
|
242
|
+
/** The staged ICE restart generation (`ProvisionalChecklist`). */
|
|
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;
|
|
129
250
|
constructor(_iceControlling: boolean, options?: Partial<IceOptions>);
|
|
130
251
|
/**
|
|
131
252
|
* Replace STUN/TURN servers after construction.
|
|
@@ -158,7 +279,35 @@ export declare class Connection implements IceConnection {
|
|
|
158
279
|
get iceControlling(): boolean;
|
|
159
280
|
set iceControlling(value: boolean);
|
|
160
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;
|
|
161
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;
|
|
162
311
|
/**
|
|
163
312
|
* Only the remote side restarted (new remote credentials in an answer to an
|
|
164
313
|
* offer that kept the local ones): the remote generation, its checks and
|
|
@@ -170,11 +319,6 @@ export declare class Connection implements IceConnection {
|
|
|
170
319
|
* replaces (or close ends), and start a signal for the next generation.
|
|
171
320
|
*/
|
|
172
321
|
private cancelChecks;
|
|
173
|
-
/**
|
|
174
|
-
* Drop the provisional generation and stop the checks still in flight for
|
|
175
|
-
* it (their retransmissions would outlive it).
|
|
176
|
-
*/
|
|
177
|
-
private endProvisional;
|
|
178
322
|
/** Accept provisional checks without changing the selected current pair. */
|
|
179
323
|
stageLocalCredentials(usernameFragment: string, password: string, gatherOptions?: Partial<IceOptions>): void;
|
|
180
324
|
discardStagedLocalCredentials(usernameFragment: string): void;
|
|
@@ -187,11 +331,6 @@ export declare class Connection implements IceConnection {
|
|
|
187
331
|
/** Start checks for the provisional generation; the selected pair is kept. */
|
|
188
332
|
startProvisionalChecks(): void;
|
|
189
333
|
get provisionalNominated(): CandidatePair | undefined;
|
|
190
|
-
private tryProvisionalPair;
|
|
191
|
-
private checkProvisional;
|
|
192
|
-
private nominateProvisional;
|
|
193
|
-
/** Incoming check for the provisional ufrag; never touches the current checklist. */
|
|
194
|
-
private checkIncomingProvisional;
|
|
195
334
|
/** Called after restart, before re-gathering the chosen generation. */
|
|
196
335
|
commitLocalCredentials(usernameFragment: string, password: string): void;
|
|
197
336
|
/**
|
|
@@ -201,11 +340,16 @@ export declare class Connection implements IceConnection {
|
|
|
201
340
|
*/
|
|
202
341
|
dropOtherRemoteGenerations(usernameFragment: string): void;
|
|
203
342
|
resetNominatedPair(): void;
|
|
343
|
+
get remoteIce2(): boolean;
|
|
344
|
+
setRemoteIceOptions(options: string[]): void;
|
|
204
345
|
setRemoteParams({ iceLite, usernameFragment, password, }: {
|
|
205
346
|
iceLite: boolean;
|
|
206
347
|
usernameFragment: string;
|
|
207
348
|
password: string;
|
|
208
349
|
}): void;
|
|
350
|
+
private retireRemoteUsername;
|
|
351
|
+
/** A check sent by a remote generation that was replaced. */
|
|
352
|
+
private isRetiredRemoteCheck;
|
|
209
353
|
/**
|
|
210
354
|
* Gather the local candidates of the current generation.
|
|
211
355
|
*
|
|
@@ -216,56 +360,115 @@ export declare class Connection implements IceConnection {
|
|
|
216
360
|
* allocation), so a caller may let it finish in the background.
|
|
217
361
|
*/
|
|
218
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;
|
|
376
|
+
/**
|
|
377
|
+
* Resolves when the current generation's gathering has ended
|
|
378
|
+
* (`localCandidatesEnd`): {@link Connection.gatherCandidates} returns once
|
|
379
|
+
* the host sockets, the TURN allocations and the representative socket's
|
|
380
|
+
* server-reflexive query are done, while the other host sockets' queries
|
|
381
|
+
* continue and trickle through `onIceCandidate`. Also resolves when the
|
|
382
|
+
* agent closes or restarts (the generation ends without its end).
|
|
383
|
+
*/
|
|
384
|
+
waitForLocalCandidatesEnd(): Promise<void>;
|
|
219
385
|
/**
|
|
220
386
|
* Whether gathering started for `generation` still belongs to the agent:
|
|
221
387
|
* no ICE restart replaced the generation and the agent is not closed.
|
|
222
388
|
*/
|
|
223
389
|
private isGathering;
|
|
224
|
-
/**
|
|
225
|
-
* Whether the provisional generation may use `protocol`: the staged
|
|
226
|
-
* generation drops the sockets its gather options exclude at the commit,
|
|
227
|
-
* so its checks never use them. A kept TURN allocation serves it only when
|
|
228
|
-
* the generation still uses that TURN server, credential and transport (any of its
|
|
229
|
-
* TURN servers): one whose server was removed or replaced (a credential
|
|
230
|
-
* rotation) is not part of it.
|
|
231
|
-
*/
|
|
232
|
-
private allowsProvisional;
|
|
233
390
|
/** A copy of `candidate` labelled with the current generation and ufrag. */
|
|
234
391
|
private withGeneration;
|
|
235
392
|
/** Whether gathering contacts a STUN or TURN server (more than re-advertising sockets). */
|
|
236
393
|
get gathersFromServers(): boolean;
|
|
237
394
|
private appendLocalCandidate;
|
|
395
|
+
/**
|
|
396
|
+
* Report a failed STUN query / TURN allocation of the gathering whose
|
|
397
|
+
* `stale` is given (see onIceCandidateError). A failure that is not
|
|
398
|
+
* reported (cancelled), belongs to a replaced generation or arrives after
|
|
399
|
+
* close is dropped. A listener that throws does not stop the gathering.
|
|
400
|
+
*/
|
|
401
|
+
private emitCandidateError;
|
|
402
|
+
/** Report that `server` answered the gathering whose `stale` is given. */
|
|
403
|
+
private emitServerReached;
|
|
238
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;
|
|
239
417
|
/**
|
|
240
418
|
* RFC 6544: the selected TCP connection is the only path for this component;
|
|
241
419
|
* once it is closed no application data or consent check can reach the peer,
|
|
242
420
|
* so fail the same way as a consent expiry instead of waiting for it.
|
|
243
421
|
*/
|
|
244
422
|
private handleConnectionClosed;
|
|
245
|
-
|
|
423
|
+
connect(): Promise<void>;
|
|
246
424
|
/**
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
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.
|
|
251
429
|
*/
|
|
252
|
-
private
|
|
253
|
-
|
|
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;
|
|
254
453
|
private unfreezeInitial;
|
|
255
454
|
private schedulingChecks;
|
|
256
455
|
/**
|
|
257
|
-
*
|
|
258
|
-
*
|
|
456
|
+
* Mirror libwebrtc semi-aggressive nomination (not required by RFC 7675):
|
|
457
|
+
* attach USE-CANDIDATE to consent checks of the selected pair when we are
|
|
458
|
+
* controlling and the remote is ICE-lite, or we nominate semi-aggressively
|
|
459
|
+
* (a peer that became controlled after a role conflict, or lost the
|
|
460
|
+
* nominating response, learns the selection from them).
|
|
259
461
|
*/
|
|
260
|
-
private
|
|
462
|
+
private shouldNominateConsentRequest;
|
|
261
463
|
/**
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
464
|
+
* Renomination: the NOMINATION value consent checks of the selected pair
|
|
465
|
+
* carry, so the peer keeps (or learns) the selection. A pair selected
|
|
466
|
+
* without a renomination of this agent (the peer nominated it while this
|
|
467
|
+
* agent was controlled) takes the next value.
|
|
265
468
|
*/
|
|
266
|
-
private
|
|
267
|
-
private
|
|
268
|
-
|
|
469
|
+
private consentNomination;
|
|
470
|
+
private applicationDataPair;
|
|
471
|
+
/** Start RFC 7675 consent freshness for the selected pair. */
|
|
269
472
|
private queryConsent;
|
|
270
473
|
close(): Promise<void>;
|
|
271
474
|
private setState;
|
|
@@ -278,6 +481,11 @@ export declare class Connection implements IceConnection {
|
|
|
278
481
|
* the pairing and provisional lifecycle together.
|
|
279
482
|
*/
|
|
280
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;
|
|
281
489
|
send: (data: Buffer) => Promise<void>;
|
|
282
490
|
getDefaultCandidate(): Candidate;
|
|
283
491
|
set remoteCandidates(value: Candidate[]);
|
|
@@ -285,46 +493,246 @@ export declare class Connection implements IceConnection {
|
|
|
285
493
|
get candidatePairs(): CandidatePair[];
|
|
286
494
|
private sortCheckList;
|
|
287
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;
|
|
288
514
|
private applyIceControlling;
|
|
515
|
+
/**
|
|
516
|
+
* The agent became controlling with a pair already selected (live or
|
|
517
|
+
* provisional), e.g. one the peer nominated while this agent was
|
|
518
|
+
* controlled. The selection stays (RFC 8445 §8.1.1 allows no other pair),
|
|
519
|
+
* but the peer, controlled now, may still wait for a nomination: send
|
|
520
|
+
* USE-CANDIDATE for that pair, repeated on timeouts as a nomination is.
|
|
521
|
+
* A peer that selected the pair already keeps it.
|
|
522
|
+
*/
|
|
523
|
+
private confirmSelections;
|
|
524
|
+
private confirmSelection;
|
|
525
|
+
/**
|
|
526
|
+
* The role changed: a nomination in flight (live or provisional) was sent
|
|
527
|
+
* as the controlling agent and must not select a pair, fail one, or fail
|
|
528
|
+
* the agent under the new role. Its transaction stops; a controlling agent
|
|
529
|
+
* later nominates afresh.
|
|
530
|
+
*/
|
|
531
|
+
private invalidateNominations;
|
|
289
532
|
private switchRole;
|
|
290
533
|
private checkComplete;
|
|
534
|
+
/**
|
|
535
|
+
* Fail the check list once no pair can succeed and no nomination can still
|
|
536
|
+
* select one. Background gathering and remote trickle both delay this.
|
|
537
|
+
*/
|
|
538
|
+
private concludeCheckListIfExhausted;
|
|
291
539
|
checkStart: (pair: CandidatePair) => {
|
|
292
540
|
awaitable: Promise<void>;
|
|
293
541
|
resolve: (value: void | PromiseLike<void>) => void;
|
|
294
542
|
reject: (reason?: any) => void;
|
|
295
543
|
};
|
|
544
|
+
/**
|
|
545
|
+
* A check of the live checklist cancelled before its outcome (the
|
|
546
|
+
* checklist completed, `connect` cancels the remaining checks) leaves the
|
|
547
|
+
* pair Waiting instead of In-Progress, so the peer's checks on it still
|
|
548
|
+
* trigger one (7.2.1.4): a controlled agent that selected a lower pair can
|
|
549
|
+
* then follow a later nomination of this one. A nomination already received
|
|
550
|
+
* for it is checked at once (its triggering check came while the cancelled
|
|
551
|
+
* one was still in flight). A generation that ended or a closed agent
|
|
552
|
+
* changes nothing.
|
|
553
|
+
*/
|
|
554
|
+
private checkCancelled;
|
|
296
555
|
/**
|
|
297
556
|
* 487 / 401 retry of a check: the retry is cancelled with the check it
|
|
298
557
|
* replaces (its handle) and, through checkStart, with the generation.
|
|
299
558
|
*/
|
|
300
559
|
private retryCheck;
|
|
301
560
|
private isTcpPair;
|
|
561
|
+
private checkRequestOptions;
|
|
562
|
+
/** The agent is controlling and both agents are full ICE. */
|
|
563
|
+
private nominatesFullPeer;
|
|
302
564
|
/**
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
* nominates exactly one valid pair (RFC 8445 §8.1.1 regular nomination).
|
|
565
|
+
* Both agents advertised renomination (`IceOptions.renomination`): the
|
|
566
|
+
* controlling agent nominates with NOMINATION values instead of
|
|
567
|
+
* USE-CANDIDATE, whatever `IceOptions.nomination` says.
|
|
307
568
|
*/
|
|
308
|
-
private
|
|
309
|
-
|
|
569
|
+
private usesRenomination;
|
|
570
|
+
/**
|
|
571
|
+
* `nomination: "regular"`: RFC 8445 §8.1.1 regular nomination for every
|
|
572
|
+
* transport. A check that succeeds only makes its pair valid;
|
|
573
|
+
* `RegularNomination` later picks one valid pair and nominates it once
|
|
574
|
+
* with a separate USE-CANDIDATE check.
|
|
575
|
+
*/
|
|
576
|
+
private usesRegularNomination;
|
|
577
|
+
/**
|
|
578
|
+
* The default, as libwebrtc: checks carry USE-CANDIDATE until a pair is
|
|
579
|
+
* selected and afterwards for pairs that outrank the selected one, so the
|
|
580
|
+
* first pair that succeeds is selected at once and a higher-priority pair
|
|
581
|
+
* that succeeds later (a TURN/UDP candidate trickled after a TURN/TCP one
|
|
582
|
+
* connected) replaces it. A first-success-wins nomination would keep the
|
|
583
|
+
* lower-priority pair for the whole session.
|
|
584
|
+
*/
|
|
585
|
+
private usesSemiAggressiveNomination;
|
|
310
586
|
/**
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
587
|
+
* The controlling agent may move the selection to a higher-priority pair
|
|
588
|
+
* (semi-aggressive nomination, renomination): checks of pairs that outrank
|
|
589
|
+
* the selected one go on after the first selection.
|
|
314
590
|
*/
|
|
315
|
-
private
|
|
316
|
-
|
|
317
|
-
|
|
591
|
+
private replacesSelection;
|
|
592
|
+
/**
|
|
593
|
+
* A pair semi-aggressive nomination and renomination may select: not an
|
|
594
|
+
* ICE-TCP pair (each TCP pair is its own connection, and nominating more
|
|
595
|
+
* than one could leave the agents on different connections after pruning;
|
|
596
|
+
* TCP pairs keep regular nomination, see `regularNominationPairs`), nor
|
|
597
|
+
* one the agent never checks (forceTurn).
|
|
598
|
+
*/
|
|
599
|
+
private replacesWith;
|
|
600
|
+
/**
|
|
601
|
+
* The pairs `RegularNomination` nominates from: every pair with
|
|
602
|
+
* `nomination: "regular"`, otherwise the ICE-TCP pairs (as before
|
|
603
|
+
* semi-aggressive nomination, #721).
|
|
604
|
+
*/
|
|
605
|
+
private regularNominationPairs;
|
|
606
|
+
/** `IceOptions.nominationDelayMs`, or its default when unset or invalid. */
|
|
607
|
+
private get nominationDelayMs();
|
|
608
|
+
/** A pair the agent never checks itself (forceTurn keeps it from the schedule). */
|
|
609
|
+
private isUncheckedPair;
|
|
610
|
+
/** The highest-priority valid pair of `pairs`. */
|
|
611
|
+
private bestValidPair;
|
|
612
|
+
private outranks;
|
|
613
|
+
/**
|
|
614
|
+
* The live checklist's side of regular nomination (`RegularNomination`):
|
|
615
|
+
* the controlling agent nominates the best valid pair once the checklist
|
|
616
|
+
* is quiet (see `decideNomination`).
|
|
617
|
+
*/
|
|
618
|
+
private liveNominationHost;
|
|
619
|
+
/**
|
|
620
|
+
* Send the USE-CANDIDATE check for a live `pair` (see `NominationOutcome`),
|
|
621
|
+
* or with `nomination` the renomination check that carries that
|
|
622
|
+
* NOMINATION value instead.
|
|
623
|
+
*/
|
|
624
|
+
private sendNomination;
|
|
625
|
+
/**
|
|
626
|
+
* No attempt of a USE-CANDIDATE check was answered, or the pair a
|
|
627
|
+
* provisional nomination may have selected (`NominationHint`) failed or
|
|
628
|
+
* never appeared. A request may still have reached the peer, and a
|
|
629
|
+
* controlled agent keeps the first pair
|
|
630
|
+
* nominated to it (RFC 8445 §8.1.1): nominating another pair could leave
|
|
631
|
+
* the two agents on different pairs. The agent nominates nothing else,
|
|
632
|
+
* connect() rejects and the agent fails (an ICE restart starts over), as a
|
|
633
|
+
* consent expiry does.
|
|
634
|
+
*/
|
|
635
|
+
private nominationAbandoned;
|
|
636
|
+
/**
|
|
637
|
+
* At the restart that ends the provisional checklist (a final answer): the
|
|
638
|
+
* pair it nominated, or sent a USE-CANDIDATE to that the peer did not
|
|
639
|
+
* refuse (see `NominationHint`).
|
|
640
|
+
*/
|
|
641
|
+
private provisionalNominationHint;
|
|
642
|
+
/** The agent was closed or restarted while the ICE-lite nomination was in flight. */
|
|
318
643
|
private isStaleNomination;
|
|
319
644
|
private addPair;
|
|
645
|
+
private ensureIncomingPair;
|
|
320
646
|
checkIncoming(message: Message, addr: Address, protocol: Protocol): void;
|
|
647
|
+
/**
|
|
648
|
+
* @param admit after a selection that may still be replaced, only pairs
|
|
649
|
+
* that could replace it join the checklist.
|
|
650
|
+
*/
|
|
321
651
|
private tryPair;
|
|
652
|
+
/** See `tryPair`: undefined admits every pair. */
|
|
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;
|
|
322
729
|
/**
|
|
323
730
|
* Pair a local candidate gathered after remote candidates arrived (a late
|
|
324
731
|
* TURN allocation, a slow host socket) with them.
|
|
325
732
|
*/
|
|
326
733
|
private pairLocalProtocol;
|
|
327
734
|
private pairRemoteCandidate;
|
|
735
|
+
/** A connectivity check from this agent (`buildCheckRequest`). */
|
|
328
736
|
private buildRequest;
|
|
329
737
|
private pruneTcpConnections;
|
|
330
738
|
private respondError;
|