werift 0.26.0 → 0.28.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 -8
- package/THIRD_PARTY_LICENSES_LIBWEBRTC.txt +58 -0
- package/lib/common/src/binary.d.ts +1 -3
- package/lib/common/src/binary.js +8 -6
- package/lib/common/src/binary.js.map +1 -1
- package/lib/common/src/binaryData.js +2 -1
- package/lib/common/src/binaryData.js.map +1 -1
- 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/log.js +5 -7
- package/lib/common/src/log.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 +12 -5
- package/lib/common/src/transport.js +13 -7
- 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/client.js +15 -1
- package/lib/dtls/src/client.js.map +1 -1
- package/lib/dtls/src/context/cipher.d.ts +1 -1
- package/lib/dtls/src/context/cipher.js +6 -3
- package/lib/dtls/src/context/cipher.js.map +1 -1
- package/lib/dtls/src/context/dtls.d.ts +2 -0
- package/lib/dtls/src/context/dtls.js +11 -2
- package/lib/dtls/src/context/dtls.js.map +1 -1
- package/lib/dtls/src/context/transport.d.ts +17 -1
- package/lib/dtls/src/context/transport.js +40 -3
- package/lib/dtls/src/context/transport.js.map +1 -1
- package/lib/dtls/src/flight/client/flight1.js +2 -1
- package/lib/dtls/src/flight/client/flight1.js.map +1 -1
- package/lib/dtls/src/flight/client/flight5.js +8 -3
- package/lib/dtls/src/flight/client/flight5.js.map +1 -1
- package/lib/dtls/src/flight/flight.d.ts +6 -1
- package/lib/dtls/src/flight/flight.js +18 -5
- package/lib/dtls/src/flight/flight.js.map +1 -1
- package/lib/dtls/src/flight/server/flight4.js +4 -2
- package/lib/dtls/src/flight/server/flight4.js.map +1 -1
- package/lib/dtls/src/flight/server/flight6.js +6 -2
- package/lib/dtls/src/flight/server/flight6.js.map +1 -1
- package/lib/dtls/src/handshake/const.d.ts +17 -13
- package/lib/dtls/src/handshake/const.js +16 -14
- package/lib/dtls/src/handshake/const.js.map +1 -1
- package/lib/dtls/src/handshake/message/alert.js +4 -2
- package/lib/dtls/src/handshake/message/alert.js.map +1 -1
- package/lib/dtls/src/handshake/message/certificate.js +2 -1
- package/lib/dtls/src/handshake/message/certificate.js.map +1 -1
- package/lib/dtls/src/handshake/message/changeCipherSpec.js +2 -1
- package/lib/dtls/src/handshake/message/changeCipherSpec.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/certificateVerify.js +4 -2
- package/lib/dtls/src/handshake/message/client/certificateVerify.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/hello.js +14 -7
- package/lib/dtls/src/handshake/message/client/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/keyExchange.js +2 -1
- package/lib/dtls/src/handshake/message/client/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/message/finished.js +2 -1
- package/lib/dtls/src/handshake/message/finished.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/certificateRequest.js +6 -3
- package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/hello.js +12 -6
- package/lib/dtls/src/handshake/message/server/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloDone.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js +4 -2
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/keyExchange.js +16 -8
- package/lib/dtls/src/handshake/message/server/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/random.d.ts +2 -2
- package/lib/dtls/src/handshake/random.js +5 -2
- package/lib/dtls/src/handshake/random.js.map +1 -1
- package/lib/dtls/src/index.d.ts +3 -1
- package/lib/dtls/src/index.js +10 -1
- package/lib/dtls/src/index.js.map +1 -1
- package/lib/dtls/src/record/const.d.ts +52 -33
- package/lib/dtls/src/record/const.js +51 -36
- package/lib/dtls/src/record/const.js.map +1 -1
- package/lib/dtls/src/record/message/fragment.js +12 -6
- package/lib/dtls/src/record/message/fragment.js.map +1 -1
- package/lib/dtls/src/record/message/header.js +10 -5
- package/lib/dtls/src/record/message/header.js.map +1 -1
- package/lib/dtls/src/record/message/plaintext.js +4 -2
- package/lib/dtls/src/record/message/plaintext.js.map +1 -1
- package/lib/dtls/src/record/receive.d.ts +6 -0
- package/lib/dtls/src/record/receive.js +50 -19
- package/lib/dtls/src/record/receive.js.map +1 -1
- package/lib/dtls/src/server.js +19 -1
- package/lib/dtls/src/server.js.map +1 -1
- package/lib/dtls/src/socket.d.ts +134 -2
- package/lib/dtls/src/socket.js +326 -8
- package/lib/dtls/src/socket.js.map +1 -1
- package/lib/ice/src/candidate.d.ts +1 -1
- package/lib/ice/src/candidate.js +24 -12
- package/lib/ice/src/candidate.js.map +1 -1
- 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 +49 -0
- package/lib/ice/src/consent.js +258 -0
- package/lib/ice/src/consent.js.map +1 -0
- package/lib/ice/src/dns/lookup.d.ts +10 -1
- package/lib/ice/src/dns/lookup.js +42 -7
- package/lib/ice/src/dns/lookup.js.map +1 -1
- package/lib/ice/src/exceptions.d.ts +21 -5
- package/lib/ice/src/exceptions.js +58 -13
- package/lib/ice/src/exceptions.js.map +1 -1
- package/lib/ice/src/ice.d.ts +254 -58
- package/lib/ice/src/ice.js +979 -945
- package/lib/ice/src/ice.js.map +1 -1
- package/lib/ice/src/iceBase.d.ts +328 -14
- package/lib/ice/src/iceBase.js +254 -38
- package/lib/ice/src/iceBase.js.map +1 -1
- package/lib/ice/src/index.d.ts +1 -0
- package/lib/ice/src/index.js +1 -0
- 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/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 +17 -0
- package/lib/ice/src/internal/hostInterfaces.js +77 -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/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/selectionReplacement.d.ts +138 -0
- package/lib/ice/src/nomination/selectionReplacement.js +371 -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/stun/protocol.d.ts +9 -2
- package/lib/ice/src/stun/protocol.js +16 -17
- package/lib/ice/src/stun/protocol.js.map +1 -1
- package/lib/ice/src/stun/tcpProtocol.d.ts +1 -1
- package/lib/ice/src/stun/tcpProtocol.js +7 -7
- package/lib/ice/src/stun/tcpProtocol.js.map +1 -1
- package/lib/ice/src/stun/transaction.d.ts +30 -1
- package/lib/ice/src/stun/transaction.js +90 -19
- package/lib/ice/src/stun/transaction.js.map +1 -1
- package/lib/ice/src/turn/credential.d.ts +49 -0
- package/lib/ice/src/turn/credential.js +78 -0
- package/lib/ice/src/turn/credential.js.map +1 -0
- package/lib/ice/src/turn/protocol.d.ts +31 -10
- package/lib/ice/src/turn/protocol.js +127 -51
- package/lib/ice/src/turn/protocol.js.map +1 -1
- package/lib/ice/src/types/model.d.ts +16 -5
- package/lib/ice/src/types/model.js.map +1 -1
- package/lib/ice-server/src/stun/attributes.d.ts +2 -0
- package/lib/ice-server/src/stun/attributes.js +11 -1
- package/lib/ice-server/src/stun/attributes.js.map +1 -1
- package/lib/ice-server/src/stun/const.d.ts +44 -17
- package/lib/ice-server/src/stun/const.js +31 -19
- package/lib/ice-server/src/stun/const.js.map +1 -1
- package/lib/ice-server/src/stun/message.d.ts +29 -4
- package/lib/ice-server/src/stun/message.js +115 -24
- package/lib/ice-server/src/stun/message.js.map +1 -1
- package/lib/index.mjs +35121 -22337
- package/lib/nonstandard/index.mjs +3169 -1399
- package/lib/polyfill/dom.mjs +24650 -12365
- package/lib/polyfill/index.mjs +24650 -12365
- package/lib/rtp/src/codec/assertPayload.d.ts +4 -0
- package/lib/rtp/src/codec/assertPayload.js +12 -0
- package/lib/rtp/src/codec/assertPayload.js.map +1 -0
- package/lib/rtp/src/codec/av1.js +2 -0
- package/lib/rtp/src/codec/av1.js.map +1 -1
- package/lib/rtp/src/codec/h264.js +35 -43
- package/lib/rtp/src/codec/h264.js.map +1 -1
- package/lib/rtp/src/codec/vp8.js +11 -5
- package/lib/rtp/src/codec/vp8.js.map +1 -1
- package/lib/rtp/src/codec/vp9.js +12 -0
- package/lib/rtp/src/codec/vp9.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/container.js +2 -1
- package/lib/rtp/src/extra/container/mp4/container.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/exp-golomb.js +2 -1
- package/lib/rtp/src/extra/container/mp4/exp-golomb.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/h264.d.ts +21 -17
- package/lib/rtp/src/extra/container/mp4/h264.js +26 -24
- package/lib/rtp/src/extra/container/mp4/h264.js.map +1 -1
- package/lib/rtp/src/extra/container/ogg/index.d.ts +1 -0
- package/lib/rtp/src/extra/container/ogg/index.js +1 -0
- package/lib/rtp/src/extra/container/ogg/index.js.map +1 -1
- package/lib/rtp/src/extra/container/ogg/writer.d.ts +90 -0
- package/lib/rtp/src/extra/container/ogg/writer.js +300 -0
- package/lib/rtp/src/extra/container/ogg/writer.js.map +1 -0
- package/lib/rtp/src/extra/container/webm/ebml/ebml.js +6 -3
- package/lib/rtp/src/extra/container/webm/ebml/ebml.js.map +1 -1
- package/lib/rtp/src/extra/processor/depacketizer.d.ts +5 -0
- package/lib/rtp/src/extra/processor/depacketizer.js +28 -2
- package/lib/rtp/src/extra/processor/depacketizer.js.map +1 -1
- package/lib/rtp/src/extra/processor/dtx.js +4 -2
- package/lib/rtp/src/extra/processor/dtx.js.map +1 -1
- package/lib/rtp/src/extra/processor/index.d.ts +2 -0
- package/lib/rtp/src/extra/processor/index.js +2 -0
- package/lib/rtp/src/extra/processor/index.js.map +1 -1
- package/lib/rtp/src/extra/processor/jitterBuffer.d.ts +29 -6
- package/lib/rtp/src/extra/processor/jitterBuffer.js +101 -111
- package/lib/rtp/src/extra/processor/jitterBuffer.js.map +1 -1
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.js +2 -1
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.js.map +1 -1
- package/lib/rtp/src/extra/processor/lipsync.d.ts +63 -0
- package/lib/rtp/src/extra/processor/lipsync.js +202 -51
- package/lib/rtp/src/extra/processor/lipsync.js.map +1 -1
- package/lib/rtp/src/extra/processor/mp4.d.ts +0 -6
- package/lib/rtp/src/extra/processor/mp4.js +6 -3
- package/lib/rtp/src/extra/processor/mp4.js.map +1 -1
- package/lib/rtp/src/extra/processor/mute.js +4 -2
- package/lib/rtp/src/extra/processor/mute.js.map +1 -1
- package/lib/rtp/src/extra/processor/nack.js +4 -2
- package/lib/rtp/src/extra/processor/nack.js.map +1 -1
- package/lib/rtp/src/extra/processor/ntpTime.js +4 -6
- package/lib/rtp/src/extra/processor/ntpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/ogg.d.ts +72 -0
- package/lib/rtp/src/extra/processor/ogg.js +221 -0
- package/lib/rtp/src/extra/processor/ogg.js.map +1 -0
- package/lib/rtp/src/extra/processor/oggCallback.d.ts +21 -0
- package/lib/rtp/src/extra/processor/oggCallback.js +97 -0
- package/lib/rtp/src/extra/processor/oggCallback.js.map +1 -0
- package/lib/rtp/src/extra/processor/rtpCallback.js +2 -1
- package/lib/rtp/src/extra/processor/rtpCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpStream.js +2 -1
- package/lib/rtp/src/extra/processor/rtpStream.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpTime.js +2 -1
- package/lib/rtp/src/extra/processor/rtpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/webm.js +14 -7
- package/lib/rtp/src/extra/processor/webm.js.map +1 -1
- package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -1
- package/lib/rtp/src/index.d.ts +8 -0
- package/lib/rtp/src/index.js +8 -0
- package/lib/rtp/src/index.js.map +1 -1
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.d.ts +4 -0
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js +4 -0
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js.map +1 -1
- package/lib/rtp/src/rtcp/rtcp.js +8 -4
- package/lib/rtp/src/rtcp/rtcp.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.d.ts +58 -0
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js +143 -0
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js.map +1 -0
- package/lib/rtp/src/rtcp/rtpfb/twcc.d.ts +35 -13
- package/lib/rtp/src/rtcp/rtpfb/twcc.js +132 -54
- package/lib/rtp/src/rtcp/rtpfb/twcc.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.d.ts +13 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js +29 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js.map +1 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.d.ts +41 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js +89 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js.map +1 -0
- package/lib/rtp/src/rtcp/sr.js +1 -0
- package/lib/rtp/src/rtcp/sr.js.map +1 -1
- package/lib/rtp/src/rtp/continuity.d.ts +49 -0
- package/lib/rtp/src/rtp/continuity.js +120 -0
- package/lib/rtp/src/rtp/continuity.js.map +1 -0
- package/lib/rtp/src/rtp/headerExtension.js +41 -21
- package/lib/rtp/src/rtp/headerExtension.js.map +1 -1
- package/lib/rtp/src/rtp/padding.d.ts +17 -0
- package/lib/rtp/src/rtp/padding.js +37 -0
- package/lib/rtp/src/rtp/padding.js.map +1 -0
- package/lib/rtp/src/rtp/red/encoder.d.ts +10 -0
- package/lib/rtp/src/rtp/red/encoder.js +14 -1
- package/lib/rtp/src/rtp/red/encoder.js.map +1 -1
- package/lib/rtp/src/rtp/red/packet.js +24 -8
- package/lib/rtp/src/rtp/red/packet.js.map +1 -1
- package/lib/rtp/src/rtp/rtp.d.ts +24 -1
- package/lib/rtp/src/rtp/rtp.js +70 -29
- package/lib/rtp/src/rtp/rtp.js.map +1 -1
- package/lib/rtp/src/rtp/rtx.js +3 -0
- package/lib/rtp/src/rtp/rtx.js.map +1 -1
- package/lib/rtp/src/rtp/sendHeaderExtensions.d.ts +36 -0
- package/lib/rtp/src/rtp/sendHeaderExtensions.js +85 -0
- package/lib/rtp/src/rtp/sendHeaderExtensions.js.map +1 -0
- 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/rtp/src/srtp/cipher/ctr.js +4 -2
- package/lib/rtp/src/srtp/cipher/ctr.js.map +1 -1
- package/lib/rtp/src/srtp/cipher/index.js +8 -4
- package/lib/rtp/src/srtp/cipher/index.js.map +1 -1
- package/lib/rtp/src/srtp/context/context.js +6 -3
- package/lib/rtp/src/srtp/context/context.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtcp.d.ts +1 -1
- package/lib/rtp/src/srtp/context/srtcp.js +33 -0
- package/lib/rtp/src/srtp/context/srtcp.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtp.d.ts +1 -1
- package/lib/rtp/src/srtp/context/srtp.js +34 -10
- package/lib/rtp/src/srtp/context/srtp.js.map +1 -1
- package/lib/rtp/src/srtp/error.d.ts +8 -0
- package/lib/rtp/src/srtp/error.js +13 -1
- package/lib/rtp/src/srtp/error.js.map +1 -1
- package/lib/rtp/src/srtp/packet.js +4 -1
- package/lib/rtp/src/srtp/packet.js.map +1 -1
- package/lib/rtp/src/srtp/replay.d.ts +24 -0
- package/lib/rtp/src/srtp/replay.js +75 -0
- package/lib/rtp/src/srtp/replay.js.map +1 -0
- package/lib/rtp/src/srtp/session.js +2 -1
- package/lib/rtp/src/srtp/session.js.map +1 -1
- package/lib/rtp/src/srtp/srtcp.js +2 -1
- package/lib/rtp/src/srtp/srtcp.js.map +1 -1
- package/lib/rtp/src/srtp/srtp.js +2 -1
- package/lib/rtp/src/srtp/srtp.js.map +1 -1
- package/lib/rtp/src/util.js +2 -1
- package/lib/rtp/src/util.js.map +1 -1
- package/lib/sctp/src/chunk.d.ts +5 -0
- package/lib/sctp/src/chunk.js +31 -8
- package/lib/sctp/src/chunk.js.map +1 -1
- package/lib/sctp/src/const.d.ts +25 -17
- package/lib/sctp/src/const.js +23 -19
- package/lib/sctp/src/const.js.map +1 -1
- package/lib/sctp/src/param.d.ts +6 -2
- package/lib/sctp/src/param.js +22 -8
- package/lib/sctp/src/param.js.map +1 -1
- package/lib/sctp/src/sctp.d.ts +85 -0
- package/lib/sctp/src/sctp.js +707 -126
- package/lib/sctp/src/sctp.js.map +1 -1
- package/lib/sctp/src/transport.js +4 -2
- package/lib/sctp/src/transport.js.map +1 -1
- package/lib/webrtc/src/api/compatibilityOptions.d.ts +33 -0
- package/lib/webrtc/src/api/compatibilityOptions.js +33 -0
- package/lib/webrtc/src/api/compatibilityOptions.js.map +1 -0
- package/lib/webrtc/src/api/peerConfig.d.ts +385 -28
- package/lib/webrtc/src/api/peerConfig.js +121 -14
- package/lib/webrtc/src/api/peerConfig.js.map +1 -1
- package/lib/webrtc/src/api/peerConnectionEvents.d.ts +77 -1
- 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 +10 -0
- package/lib/webrtc/src/dataChannel.js +24 -4
- 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/index.d.ts +10 -0
- package/lib/webrtc/src/media/index.js +70 -0
- package/lib/webrtc/src/media/index.js.map +1 -1
- package/lib/webrtc/src/media/receiver/nack.d.ts +43 -10
- package/lib/webrtc/src/media/receiver/nack.js +246 -88
- package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.d.ts +61 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.js +218 -63
- package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
- package/lib/webrtc/src/media/router.d.ts +241 -40
- package/lib/webrtc/src/media/router.js +676 -205
- 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 +252 -2
- package/lib/webrtc/src/media/rtpReceiver.js +833 -44
- package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
- package/lib/webrtc/src/media/rtpSender.d.ts +191 -70
- package/lib/webrtc/src/media/rtpSender.js +631 -448
- package/lib/webrtc/src/media/rtpSender.js.map +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.d.ts +19 -3
- package/lib/webrtc/src/media/rtpTransceiver.js +74 -9
- package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
- package/lib/webrtc/src/media/sender/bandwidthEstimator.d.ts +249 -0
- package/lib/webrtc/src/media/sender/bandwidthEstimator.js +144 -0
- package/lib/webrtc/src/media/sender/bandwidthEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.d.ts +20 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.js +26 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.d.ts +70 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.js +175 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.d.ts +18 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.js +44 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.d.ts +79 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js +289 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.d.ts +87 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js +429 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.d.ts +21 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js +84 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.d.ts +37 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js +74 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.d.ts +383 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.js +408 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.d.ts +406 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js +1391 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.d.ts +19 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.js +75 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.d.ts +68 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js +201 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.d.ts +26 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js +72 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.d.ts +41 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js +99 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.d.ts +247 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js +1042 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.d.ts +26 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js +132 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.d.ts +305 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js +1073 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.d.ts +60 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js +151 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.d.ts +44 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js +246 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/index.d.ts +7 -0
- package/lib/webrtc/src/media/sender/estimators/index.js +19 -0
- package/lib/webrtc/src/media/sender/estimators/index.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.d.ts +64 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js +216 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.d.ts +117 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js +250 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js.map +1 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.d.ts +40 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.js +153 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.js.map +1 -0
- package/lib/webrtc/src/media/sender/padding.d.ts +45 -0
- package/lib/webrtc/src/media/sender/padding.js +134 -0
- package/lib/webrtc/src/media/sender/padding.js.map +1 -0
- package/lib/webrtc/src/media/sender/pendingRtp.d.ts +35 -0
- package/lib/webrtc/src/media/sender/pendingRtp.js +120 -0
- package/lib/webrtc/src/media/sender/pendingRtp.js.map +1 -0
- package/lib/webrtc/src/media/sender/rtpWire.d.ts +13 -0
- package/lib/webrtc/src/media/sender/rtpWire.js +38 -0
- package/lib/webrtc/src/media/sender/rtpWire.js.map +1 -0
- package/lib/webrtc/src/media/sender/sendPacer.d.ts +27 -0
- package/lib/webrtc/src/media/sender/sendPacer.js +110 -0
- package/lib/webrtc/src/media/sender/sendPacer.js.map +1 -0
- package/lib/webrtc/src/media/sender/senderBWE.d.ts +8 -33
- package/lib/webrtc/src/media/sender/senderBWE.js +5 -154
- package/lib/webrtc/src/media/sender/senderBWE.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 +101 -0
- package/lib/webrtc/src/media/sender/senderStats.js +317 -0
- package/lib/webrtc/src/media/sender/senderStats.js.map +1 -0
- package/lib/webrtc/src/media/track.d.ts +29 -2
- package/lib/webrtc/src/media/track.js +32 -5
- package/lib/webrtc/src/media/track.js.map +1 -1
- package/lib/webrtc/src/negotiation/bundleTopology.d.ts +1 -5
- package/lib/webrtc/src/negotiation/bundleTopology.js +15 -11
- package/lib/webrtc/src/negotiation/bundleTopology.js.map +1 -1
- package/lib/webrtc/src/negotiation/descriptionValidation.js +12 -6
- package/lib/webrtc/src/negotiation/descriptionValidation.js.map +1 -1
- package/lib/webrtc/src/negotiation/negotiationNeeded.js +2 -1
- package/lib/webrtc/src/negotiation/negotiationNeeded.js.map +1 -1
- package/lib/webrtc/src/negotiation/remoteCandidates.js +10 -5
- package/lib/webrtc/src/negotiation/remoteCandidates.js.map +1 -1
- package/lib/webrtc/src/negotiation/remoteMediaApplication.d.ts +24 -7
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js +67 -27
- 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 +8 -1
- package/lib/webrtc/src/negotiation/transportActivation.js +40 -8
- package/lib/webrtc/src/negotiation/transportActivation.js.map +1 -1
- package/lib/webrtc/src/negotiationTransaction.d.ts +43 -5
- package/lib/webrtc/src/negotiationTransaction.js +129 -13
- package/lib/webrtc/src/negotiationTransaction.js.map +1 -1
- package/lib/webrtc/src/nonstandard/dummyMedia.js +2 -1
- package/lib/webrtc/src/nonstandard/dummyMedia.js.map +1 -1
- package/lib/webrtc/src/nonstandard/navigator.js +4 -3
- package/lib/webrtc/src/nonstandard/navigator.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/index.d.ts +32 -8
- package/lib/webrtc/src/nonstandard/recorder/index.js +81 -20
- package/lib/webrtc/src/nonstandard/recorder/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.d.ts +9 -7
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js +2 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.d.ts +32 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js +185 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js.map +1 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +8 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
- package/lib/webrtc/src/nonstandard/userMedia.js +2 -1
- package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
- package/lib/webrtc/src/peerConnection.d.ts +108 -6
- package/lib/webrtc/src/peerConnection.js +357 -36
- package/lib/webrtc/src/peerConnection.js.map +1 -1
- package/lib/webrtc/src/polyfill/globals.d.ts +2 -1
- package/lib/webrtc/src/polyfill/globals.js.map +1 -1
- package/lib/webrtc/src/polyfill/install.js +2 -0
- package/lib/webrtc/src/polyfill/install.js.map +1 -1
- package/lib/webrtc/src/polyfill/mediaDevices.js +2 -1
- package/lib/webrtc/src/polyfill/mediaDevices.js.map +1 -1
- package/lib/webrtc/src/sctpManager.d.ts +46 -14
- package/lib/webrtc/src/sctpManager.js +92 -25
- package/lib/webrtc/src/sctpManager.js.map +1 -1
- package/lib/webrtc/src/sdp.d.ts +69 -0
- package/lib/webrtc/src/sdp.js +151 -20
- package/lib/webrtc/src/sdp.js.map +1 -1
- package/lib/webrtc/src/sdpManager.d.ts +85 -4
- package/lib/webrtc/src/sdpManager.js +214 -14
- package/lib/webrtc/src/sdpManager.js.map +1 -1
- package/lib/webrtc/src/secureTransportManager.d.ts +89 -4
- package/lib/webrtc/src/secureTransportManager.js +184 -26
- package/lib/webrtc/src/secureTransportManager.js.map +1 -1
- package/lib/webrtc/src/transceiverManager.d.ts +82 -4
- package/lib/webrtc/src/transceiverManager.js +239 -41
- package/lib/webrtc/src/transceiverManager.js.map +1 -1
- package/lib/webrtc/src/transport/dtls.d.ts +147 -1
- package/lib/webrtc/src/transport/dtls.js +446 -50
- package/lib/webrtc/src/transport/dtls.js.map +1 -1
- package/lib/webrtc/src/transport/ice.d.ts +71 -90
- package/lib/webrtc/src/transport/ice.js +250 -42
- package/lib/webrtc/src/transport/ice.js.map +1 -1
- package/lib/webrtc/src/transport/sctp.d.ts +25 -0
- package/lib/webrtc/src/transport/sctp.js +153 -22
- package/lib/webrtc/src/transport/sctp.js.map +1 -1
- package/lib/webrtc/src/utils.d.ts +69 -3
- package/lib/webrtc/src/utils.js +105 -16
- package/lib/webrtc/src/utils.js.map +1 -1
- package/package.json +9 -6
package/lib/ice/src/iceBase.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Candidate } from "./candidate";
|
|
2
|
+
import { type IceCandidateErrorInfo, type IceServerReachedInfo } from "./candidateError";
|
|
2
3
|
import type { MdnsLookup } from "./dns/lookup";
|
|
3
4
|
import type { Cancelable } from "./helper";
|
|
4
5
|
import { type Address, type Event, type InterfaceAddresses, type TlsConnectionOptions } from "./imports/common";
|
|
6
|
+
import { type MessageIntegrityMode } from "./stun/const";
|
|
5
7
|
import { Message } from "./stun/message";
|
|
6
8
|
import type { Protocol } from "./types/model";
|
|
7
9
|
export interface IceConnection {
|
|
@@ -12,29 +14,79 @@ export interface IceConnection {
|
|
|
12
14
|
remotePassword: string;
|
|
13
15
|
remoteUsername: string;
|
|
14
16
|
remoteIsLite: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The peer advertised `a=ice-options:renomination`. With
|
|
19
|
+
* {@link IceOptions.renomination} the controlling agent then nominates with
|
|
20
|
+
* the NOMINATION attribute (see `renomination`).
|
|
21
|
+
*/
|
|
22
|
+
remoteRenomination?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The remote `a=ice-options` tokens (RFC 8839 §5.6), e.g. `trickle`,
|
|
25
|
+
* `ice2`. Informational: werift already follows RFC 8445, so no token
|
|
26
|
+
* changes how checks or nomination run.
|
|
27
|
+
*/
|
|
28
|
+
remoteIceOptions?: string[];
|
|
29
|
+
/** The remote declared `ice2`: an RFC 8445 agent (RFC 8445 §10). */
|
|
30
|
+
readonly remoteIce2?: boolean;
|
|
15
31
|
checkList: CandidatePair[];
|
|
16
32
|
localCandidates: Candidate[];
|
|
17
33
|
remoteCandidates: Candidate[];
|
|
18
34
|
candidatePairs: CandidatePair[];
|
|
35
|
+
/**
|
|
36
|
+
* STUN servers gathering queries, normalized from the options (see
|
|
37
|
+
* {@link normalizeIceServerOptions}). Optional so that other
|
|
38
|
+
* implementations of this interface keep compiling.
|
|
39
|
+
*/
|
|
40
|
+
stunServers?: Address[];
|
|
41
|
+
/** TURN servers gathering allocates on, each with its own credential. */
|
|
42
|
+
turnServers?: TurnServerOptions[];
|
|
43
|
+
/** @deprecated The first of {@link IceConnection.stunServers}. */
|
|
19
44
|
stunServer?: Address;
|
|
45
|
+
/** @deprecated The address of the first of {@link IceConnection.turnServers}. */
|
|
20
46
|
turnServer?: Address;
|
|
21
47
|
generation: number;
|
|
22
48
|
options: IceOptions;
|
|
23
49
|
remoteCandidatesEnd: boolean;
|
|
24
50
|
localCandidatesEnd: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Resolves when `localCandidatesEnd` becomes true after `gatherCandidates()`
|
|
53
|
+
* returned (server-reflexive queries that continue in the background), or
|
|
54
|
+
* when the generation ends. Optional so that other implementations of this
|
|
55
|
+
* interface keep compiling; without it gathering ends when
|
|
56
|
+
* `gatherCandidates()` returns.
|
|
57
|
+
*/
|
|
58
|
+
waitForLocalCandidatesEnd?(): Promise<void>;
|
|
25
59
|
state: IceState;
|
|
26
60
|
lookup?: MdnsLookup;
|
|
27
61
|
nominated?: CandidatePair;
|
|
28
62
|
readonly onData: Event<[Buffer]>;
|
|
29
63
|
readonly stateChanged: Event<[IceState]>;
|
|
30
64
|
readonly onIceCandidate: Event<[Candidate]>;
|
|
65
|
+
/**
|
|
66
|
+
* A STUN or TURN server of the current generation's gathering gave no
|
|
67
|
+
* candidate (see {@link IceCandidateErrorInfo}). Optional so that other
|
|
68
|
+
* implementations of this interface keep compiling.
|
|
69
|
+
*/
|
|
70
|
+
readonly onIceCandidateError?: Event<[IceCandidateErrorInfo]>;
|
|
71
|
+
/**
|
|
72
|
+
* A STUN or TURN server of the current generation's gathering answered
|
|
73
|
+
* (see {@link IceServerReachedInfo}). Optional like onIceCandidateError.
|
|
74
|
+
*/
|
|
75
|
+
readonly onIceServerReached?: Event<[IceServerReachedInfo]>;
|
|
31
76
|
restart(): void;
|
|
77
|
+
/** Record the remote `a=ice-options` tokens (see remoteIceOptions). */
|
|
78
|
+
setRemoteIceOptions?(options: string[]): void;
|
|
32
79
|
/**
|
|
33
80
|
* Optional staged-restart and provisional-generation support. An
|
|
34
81
|
* implementation without them still restarts ICE at the final answer, but
|
|
35
82
|
* cannot answer or run checks for the new generation during pranswer.
|
|
36
83
|
*/
|
|
37
|
-
|
|
84
|
+
/**
|
|
85
|
+
* `gatherOptions`: the options the staged generation gathers with (an ICE
|
|
86
|
+
* server update applied at the commit); its provisional checks use only
|
|
87
|
+
* the sockets those options allow. Defaults to the current options.
|
|
88
|
+
*/
|
|
89
|
+
stageLocalCredentials?(usernameFragment: string, password: string, gatherOptions?: Partial<IceOptions>): void;
|
|
38
90
|
discardStagedLocalCredentials?(usernameFragment: string): void;
|
|
39
91
|
commitLocalCredentials?(usernameFragment: string, password: string): void;
|
|
40
92
|
/**
|
|
@@ -97,6 +149,18 @@ export declare class CandidatePair implements CandidatePairStats {
|
|
|
97
149
|
handle?: Cancelable<void>;
|
|
98
150
|
nominated: boolean;
|
|
99
151
|
remoteNominated: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* The largest nomination the peer sent for this pair while this agent was
|
|
154
|
+
* controlled: the NOMINATION attribute's value (renomination), or 1 for
|
|
155
|
+
* USE-CANDIDATE. The controlled agent selects the nominated pair with the
|
|
156
|
+
* largest value, the higher-priority one between equal values.
|
|
157
|
+
*/
|
|
158
|
+
remoteNomination: number;
|
|
159
|
+
/**
|
|
160
|
+
* The NOMINATION value this agent (controlling, renomination) sent for the
|
|
161
|
+
* pair and the peer answered; 0 when it did not renominate the pair.
|
|
162
|
+
*/
|
|
163
|
+
nomination: number;
|
|
100
164
|
private _state;
|
|
101
165
|
get state(): CandidatePairState;
|
|
102
166
|
packetsSent: number;
|
|
@@ -158,14 +222,46 @@ export declare const CONSENT_RESPONSE_TIMEOUT_MIN = 500;
|
|
|
158
222
|
* Falls back to {@link CONSENT_RESPONSE_TIMEOUT} when RTT is unavailable.
|
|
159
223
|
*/
|
|
160
224
|
export declare function consentResponseTimeoutMs(rttSeconds?: number): number;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
225
|
+
/**
|
|
226
|
+
* @enum
|
|
227
|
+
*/
|
|
228
|
+
export declare const CandidatePairState: {
|
|
229
|
+
readonly FROZEN: 0;
|
|
230
|
+
readonly WAITING: 1;
|
|
231
|
+
readonly IN_PROGRESS: 2;
|
|
232
|
+
readonly SUCCEEDED: 3;
|
|
233
|
+
readonly FAILED: 4;
|
|
234
|
+
};
|
|
235
|
+
export type CandidatePairState = (typeof CandidatePairState)[keyof typeof CandidatePairState];
|
|
168
236
|
export type IceState = "disconnected" | "closed" | "completed" | "new" | "connected" | "failed";
|
|
237
|
+
/** A TURN server and the credential and transport used for it. */
|
|
238
|
+
export type TurnServerOptions = {
|
|
239
|
+
address: Address;
|
|
240
|
+
username: string;
|
|
241
|
+
password: string;
|
|
242
|
+
/** Defaults to "udp" (with a TCP fallback when the UDP allocation fails). */
|
|
243
|
+
transport?: "udp" | "tcp" | "tls";
|
|
244
|
+
/**
|
|
245
|
+
* The application's names (URLs) for this server. Metadata only: the
|
|
246
|
+
* allocation does not use them. They are passed through unchanged to
|
|
247
|
+
* {@link IceServerRef.urls} of `Connection.onIceCandidateError`, so a
|
|
248
|
+
* failure can be matched to the configured server without exposing the
|
|
249
|
+
* credential. Duplicates merged by {@link normalizeIceServerOptions} have
|
|
250
|
+
* their urls merged.
|
|
251
|
+
*/
|
|
252
|
+
urls?: string[];
|
|
253
|
+
};
|
|
254
|
+
/** A TURN server as gathering uses it (see {@link normalizeIceServerOptions}). */
|
|
255
|
+
export type NormalizedTurnServer = Required<Omit<TurnServerOptions, "urls">> & Pick<TurnServerOptions, "urls">;
|
|
256
|
+
/**
|
|
257
|
+
* The application's name (URL) of a STUN server, reported in
|
|
258
|
+
* {@link IceServerRef.urls} of `Connection.onIceCandidateError`. Metadata
|
|
259
|
+
* only; several entries may name the same address.
|
|
260
|
+
*/
|
|
261
|
+
export type StunServerUrl = {
|
|
262
|
+
address: Address;
|
|
263
|
+
url: string;
|
|
264
|
+
};
|
|
169
265
|
export interface IceOptions {
|
|
170
266
|
/** Advertise and operate as an ICE lite agent. */
|
|
171
267
|
iceLite: boolean;
|
|
@@ -182,6 +278,10 @@ export interface IceOptions {
|
|
|
182
278
|
* Defaults to 5. Where UDP is blocked these STUN queries are never answered,
|
|
183
279
|
* so the wait always runs to the timeout; agents that must not stall on such
|
|
184
280
|
* networks can lower it.
|
|
281
|
+
*
|
|
282
|
+
* `gatherCandidates()` waits only for the representative sockets' queries
|
|
283
|
+
* (see `stunServers`); the other host sockets' queries continue up to this
|
|
284
|
+
* timeout in the background and end-of-candidates follows them.
|
|
185
285
|
*/
|
|
186
286
|
stunGatherTimeout?: number;
|
|
187
287
|
/**
|
|
@@ -189,16 +289,121 @@ export interface IceOptions {
|
|
|
189
289
|
* Defaults to 8.
|
|
190
290
|
*/
|
|
191
291
|
turnConnectTimeout?: number;
|
|
292
|
+
/**
|
|
293
|
+
* With `nomination: "regular"`: milliseconds the controlling agent keeps
|
|
294
|
+
* checking before it nominates (RFC 8445 §8.1.1 regular nomination). The
|
|
295
|
+
* default semi-aggressive nomination does not wait. Counted from the later of the first
|
|
296
|
+
* valid pair and the last pair added that outranks the best valid pair, so
|
|
297
|
+
* a higher-priority candidate trickled shortly after a lower-priority one
|
|
298
|
+
* succeeded can still be selected. Once both sides signalled
|
|
299
|
+
* end-of-candidates and no higher-priority pair is still being checked, the
|
|
300
|
+
* best valid pair is nominated at once. Defaults to 300; 0 nominates the
|
|
301
|
+
* best valid pair as soon as one exists. A negative or non-finite value
|
|
302
|
+
* falls back to the default.
|
|
303
|
+
*/
|
|
304
|
+
nominationDelayMs?: number;
|
|
305
|
+
/**
|
|
306
|
+
* How the controlling agent nominates toward a full ICE peer when
|
|
307
|
+
* renomination is not in use (see `renomination`).
|
|
308
|
+
*
|
|
309
|
+
* - `"semi-aggressive"` (default, as libwebrtc / Chrome): a check carries
|
|
310
|
+
* USE-CANDIDATE while no pair is selected and for every pair that
|
|
311
|
+
* outranks the selected one. The first pair whose check succeeds is
|
|
312
|
+
* selected at once; checks of higher-priority pairs go on, and one that
|
|
313
|
+
* succeeds later replaces the selection. Consent checks of the selected
|
|
314
|
+
* pair carry USE-CANDIDATE as well.
|
|
315
|
+
* - `"regular"`: RFC 8445 §8.1.1 regular nomination. Checks carry no
|
|
316
|
+
* USE-CANDIDATE; after `nominationDelayMs` (or end-of-candidates) the
|
|
317
|
+
* best valid pair is nominated once with a separate check and never
|
|
318
|
+
* replaced.
|
|
319
|
+
*
|
|
320
|
+
* Toward an ICE-lite peer the first valid pair is nominated in either mode.
|
|
321
|
+
*/
|
|
322
|
+
nomination?: "semi-aggressive" | "regular";
|
|
323
|
+
/**
|
|
324
|
+
* Renomination (draft-thatcher-ice-renomination, as libwebrtc implements
|
|
325
|
+
* it). When enabled the agent advertises `a=ice-options:renomination`
|
|
326
|
+
* (packages/webrtc). When the peer advertised it too, the controlling agent
|
|
327
|
+
* nominates with the NOMINATION attribute (0xC001) and an increasing value
|
|
328
|
+
* instead of USE-CANDIDATE: it nominates the first valid pair, keeps
|
|
329
|
+
* checking higher-priority pairs and renominates a better one when its
|
|
330
|
+
* check succeeds. This replaces `nomination` for that session.
|
|
331
|
+
*
|
|
332
|
+
* The controlled agent always honours the NOMINATION attribute: it selects
|
|
333
|
+
* the pair with the largest value. Defaults to false.
|
|
334
|
+
*/
|
|
335
|
+
renomination?: boolean;
|
|
336
|
+
/**
|
|
337
|
+
* STUN servers queried while gathering, in priority order. Every IPv4 UDP
|
|
338
|
+
* host socket queries each of them in parallel; equal mappings are
|
|
339
|
+
* advertised once, different ones (a NAT that maps per destination) each.
|
|
340
|
+
*
|
|
341
|
+
* Without `interfaceAddresses`, each family with a STUN server also gets a
|
|
342
|
+
* UDP socket bound to the wildcard address that advertises no host
|
|
343
|
+
* candidate: the OS picks its route (a full-tunnel VPN, an interface the
|
|
344
|
+
* host sockets do not cover), and its server-reflexive candidates carry
|
|
345
|
+
* the related address `0.0.0.0` / `::`. The IPv4 wildcard socket queries
|
|
346
|
+
* every server, the IPv6 one only the IPv6 literal servers. It checks only
|
|
347
|
+
* the remote candidates whose route leaves from an address no UDP host
|
|
348
|
+
* socket is bound to, so a peer on a covered path learns no
|
|
349
|
+
* peer-reflexive candidate from it.
|
|
350
|
+
*
|
|
351
|
+
* `gatherCandidates()` returns once the representative sockets answered or
|
|
352
|
+
* `stunGatherTimeout` ran out: the wildcard sockets and the host socket of
|
|
353
|
+
* the default-route address (every host socket when a family has neither).
|
|
354
|
+
* The other host sockets' server-reflexive candidates trickle through
|
|
355
|
+
* `onIceCandidate`, and `localCandidatesEnd` follows the last of them
|
|
356
|
+
* (`waitForLocalCandidatesEnd()`), so an interface that cannot reach the
|
|
357
|
+
* STUN server does not delay the description.
|
|
358
|
+
*
|
|
359
|
+
* Merged with the deprecated `stunServer`: the singular one comes first,
|
|
360
|
+
* duplicates are dropped (see {@link normalizeIceServerOptions}).
|
|
361
|
+
*/
|
|
362
|
+
stunServers?: Address[];
|
|
363
|
+
/**
|
|
364
|
+
* The application's names (URLs) of {@link IceOptions.stunServers}, by
|
|
365
|
+
* address. Metadata only, reported in {@link IceServerRef.urls} of
|
|
366
|
+
* `Connection.onIceCandidateError`; replaced together with the STUN
|
|
367
|
+
* servers (see {@link mergeIceServerOptions}).
|
|
368
|
+
*/
|
|
369
|
+
stunServerUrls?: StunServerUrl[];
|
|
370
|
+
/**
|
|
371
|
+
* TURN servers allocated on while gathering, in priority order. Each one
|
|
372
|
+
* gets its own allocation with its own credential and transport; one that
|
|
373
|
+
* fails or times out does not stop the others. Gathering ends when the
|
|
374
|
+
* slowest allocation completes or fails (`turnConnectTimeout` bounds a
|
|
375
|
+
* TCP/TLS connection, the STUN transaction timeout an unanswered request).
|
|
376
|
+
* `turnTlsOptions`, `turnUdpFamily`, `turnConnectTimeout`, `portRange` and
|
|
377
|
+
* `interfaceAddresses` apply to every TURN server.
|
|
378
|
+
*
|
|
379
|
+
* Merged with the deprecated `turnServer` / `turnUsername` /
|
|
380
|
+
* `turnPassword` / `turnTransport`: the singular one comes first,
|
|
381
|
+
* duplicates are dropped and an entry without username / password is
|
|
382
|
+
* ignored (see {@link normalizeIceServerOptions}).
|
|
383
|
+
*/
|
|
384
|
+
turnServers?: TurnServerOptions[];
|
|
385
|
+
/** @deprecated Use {@link IceOptions.stunServers}. Kept as their first entry. */
|
|
192
386
|
stunServer?: Address;
|
|
387
|
+
/**
|
|
388
|
+
* Whether the built-in public STUN server (stun.l.google.com:19302) is used
|
|
389
|
+
* when no STUN server is given. Defaults to true; false gathers no
|
|
390
|
+
* server-reflexive candidate unless a STUN server is set.
|
|
391
|
+
*/
|
|
392
|
+
useDefaultStunServer?: boolean;
|
|
393
|
+
/** @deprecated Use {@link IceOptions.turnServers}. Kept as their first entry. */
|
|
193
394
|
turnServer?: Address;
|
|
395
|
+
/** @deprecated Use {@link TurnServerOptions.username} of {@link IceOptions.turnServers}. */
|
|
194
396
|
turnUsername?: string;
|
|
397
|
+
/** @deprecated Use {@link TurnServerOptions.password} of {@link IceOptions.turnServers}. */
|
|
195
398
|
turnPassword?: string;
|
|
399
|
+
/** @deprecated Use {@link TurnServerOptions.transport} of {@link IceOptions.turnServers}. */
|
|
196
400
|
turnTransport?: "udp" | "tcp" | "tls";
|
|
401
|
+
/** Applied to every TLS TURN server. */
|
|
197
402
|
turnTlsOptions?: TlsConnectionOptions;
|
|
198
403
|
/**
|
|
199
|
-
* Preferred IP family of
|
|
200
|
-
* is a hostname. Ignored for an IP literal
|
|
201
|
-
* always selects the socket. Defaults to 4.
|
|
404
|
+
* Preferred IP family of a TURN/UDP socket, applied (to every TURN server)
|
|
405
|
+
* only when the server is a hostname. Ignored for an IP literal server,
|
|
406
|
+
* whose own family always selects the socket. Defaults to 4.
|
|
202
407
|
*/
|
|
203
408
|
turnUdpFamily?: 4 | 6;
|
|
204
409
|
forceTurn?: boolean;
|
|
@@ -218,8 +423,30 @@ export interface IceOptions {
|
|
|
218
423
|
* gathered. If the bind fails, the family has no UDP host candidate.
|
|
219
424
|
*
|
|
220
425
|
* A family left unspecified while the other one is set gathers no
|
|
221
|
-
* enumerated addresses (only its `additionalHostAddresses`).
|
|
222
|
-
*
|
|
426
|
+
* enumerated addresses (only its `additionalHostAddresses`).
|
|
427
|
+
*
|
|
428
|
+
* Without any family set, every enumerated address gets its own UDP host
|
|
429
|
+
* socket bound to that address (an IPv6 link-local one with its zone), so
|
|
430
|
+
* the socket's packets leave from the advertised candidate address even on
|
|
431
|
+
* a host with several network interfaces. An address whose bind fails, or
|
|
432
|
+
* whose sends fail, loses only its own candidate; the other addresses are
|
|
433
|
+
* unaffected. An `additionalHostAddresses` entry that is not assigned to a
|
|
434
|
+
* local interface (a 1:1 NAT public address, for example) is gathered over
|
|
435
|
+
* a wildcard socket. The enumerated addresses include costly networks (VPN
|
|
436
|
+
* / tunnel interfaces: `ipsec`, `tun`, `utun`, `tap`) with a low local
|
|
437
|
+
* preference; `vmnet` / `veth` interfaces are excluded. The default-route
|
|
438
|
+
* address gets the highest local preference, so checks start with the path
|
|
439
|
+
* the OS uses: the source address of the route to the first configured
|
|
440
|
+
* STUN / TURN server that resolves in the family and has a route (UDP
|
|
441
|
+
* `connect()`, no packet is sent). A family without such a server has no
|
|
442
|
+
* default-route address: no other address (no public one) is probed in
|
|
443
|
+
* its place, and its host candidates keep the gathering order. With a STUN
|
|
444
|
+
* server, a wildcard socket per family maps the route the
|
|
445
|
+
* OS picks (see `stunServers`).
|
|
446
|
+
*
|
|
447
|
+
* A family set to the wildcard address (`0.0.0.0` / `::`) gathers its
|
|
448
|
+
* enumerated and additional addresses over wildcard sockets instead;
|
|
449
|
+
* the wildcard address itself is never advertised.
|
|
223
450
|
*/
|
|
224
451
|
interfaceAddresses?: InterfaceAddresses;
|
|
225
452
|
/**
|
|
@@ -230,6 +457,20 @@ export interface IceOptions {
|
|
|
230
457
|
additionalHostAddresses?: string[];
|
|
231
458
|
filterStunResponse?: (message: Message, addr: Address, protocol: Protocol) => boolean;
|
|
232
459
|
filterCandidatePair?: (pair: CandidatePair) => boolean;
|
|
460
|
+
/**
|
|
461
|
+
* Integrity attributes of the connectivity checks and consent requests this
|
|
462
|
+
* agent sends (short-term credentials, RFC 8489):
|
|
463
|
+
* - `"sha1"` (default): MESSAGE-INTEGRITY only, what every browser accepts.
|
|
464
|
+
* - `"sha256"`: MESSAGE-INTEGRITY-SHA256 only. A peer that does not know
|
|
465
|
+
* the comprehension-required 0x001C attribute rejects such checks (420
|
|
466
|
+
* or no answer), so use it only with a peer known to support it.
|
|
467
|
+
* - `"both"`: MESSAGE-INTEGRITY followed by MESSAGE-INTEGRITY-SHA256.
|
|
468
|
+
*
|
|
469
|
+
* Received requests and responses are accepted with either algorithm, and
|
|
470
|
+
* a response is always signed with the algorithm of its request
|
|
471
|
+
* (MESSAGE-INTEGRITY-SHA256 when the request carried it, RFC 8489 §9.1.3).
|
|
472
|
+
*/
|
|
473
|
+
messageIntegrity?: MessageIntegrityMode;
|
|
233
474
|
}
|
|
234
475
|
export declare const defaultOptions: IceOptions;
|
|
235
476
|
export declare function validateRemoteCandidate(candidate: Candidate): Candidate;
|
|
@@ -240,6 +481,79 @@ export declare function sortCandidatePairs(pairs: {
|
|
|
240
481
|
localCandidate: Pick<Candidate, "priority">;
|
|
241
482
|
remoteCandidate: Pick<Candidate, "priority">;
|
|
242
483
|
}[];
|
|
484
|
+
/**
|
|
485
|
+
* `2^32 * MIN(G,D) + 2 * MAX(G,D) + (G > D ? 1 : 0)` (RFC 8445 §6.1.2.3).
|
|
486
|
+
* The value can exceed `Number.MAX_SAFE_INTEGER`, so it is approximate;
|
|
487
|
+
* order pairs with `compareCandidatePairPriority`, which is exact.
|
|
488
|
+
*/
|
|
243
489
|
export declare function candidatePairPriority(local: Pick<Candidate, "priority">, remote: Pick<Candidate, "priority">, iceControlling: boolean): number;
|
|
244
|
-
|
|
490
|
+
/**
|
|
491
|
+
* Exact comparison of two pair priorities (RFC 8445 §6.1.2.3): negative
|
|
492
|
+
* when pair `a` has the lower priority, positive when the higher, 0 when equal.
|
|
493
|
+
*/
|
|
494
|
+
export declare function compareCandidatePairPriority(aLocal: Pick<Candidate, "priority">, aRemote: Pick<Candidate, "priority">, bLocal: Pick<Candidate, "priority">, bRemote: Pick<Candidate, "priority">, iceControlling: boolean): number;
|
|
495
|
+
/**
|
|
496
|
+
* Query `stunServer` from `protocol` for a server-reflexive candidate.
|
|
497
|
+
* Unlike {@link serverReflexiveCandidate} it rejects with the reason of a
|
|
498
|
+
* failure. `base` is used for wildcard sockets that advertise no host
|
|
499
|
+
* candidate themselves.
|
|
500
|
+
*/
|
|
501
|
+
export declare function queryServerReflexiveCandidate(protocol: Protocol, stunServer: Address, base?: Pick<Candidate, "host" | "port" | "transport" | "component"> & Partial<Pick<Candidate, "tcptype">>): Promise<Candidate>;
|
|
502
|
+
/**
|
|
503
|
+
* Query a STUN server for a server-reflexive candidate. This compatibility
|
|
504
|
+
* helper resolves `undefined` on failure; use
|
|
505
|
+
* {@link queryServerReflexiveCandidate} when the failure reason is needed.
|
|
506
|
+
*/
|
|
507
|
+
export declare function serverReflexiveCandidate(protocol: Protocol, stunServer: Address, base?: Pick<Candidate, "host" | "port" | "transport" | "component"> & Partial<Pick<Candidate, "tcptype">>): Promise<Candidate | undefined>;
|
|
245
508
|
export declare function validateAddress(addr?: Address): Address | undefined;
|
|
509
|
+
/** The STUN/TURN server fields of {@link IceOptions}, singular and plural. */
|
|
510
|
+
export type IceServerFields = Partial<Pick<IceOptions, "stunServer" | "stunServers" | "stunServerUrls" | "turnServer" | "turnServers" | "turnUsername" | "turnPassword" | "turnTransport">>;
|
|
511
|
+
/**
|
|
512
|
+
* The STUN and TURN servers `options` configure, the one place the singular
|
|
513
|
+
* (deprecated) and plural fields are merged:
|
|
514
|
+
*
|
|
515
|
+
* - order: the singular server first, then the plural list in its order;
|
|
516
|
+
* - duplicates (the same STUN address; the same TURN address, transport and
|
|
517
|
+
* credential) are kept once, at their first position;
|
|
518
|
+
* - an invalid address (see {@link validateAddress}) is dropped, and so is a
|
|
519
|
+
* TURN server without username or password (it cannot allocate);
|
|
520
|
+
* - a TURN transport left unset is "udp";
|
|
521
|
+
* - the `urls` of merged TURN duplicates are merged (in order, once each).
|
|
522
|
+
*
|
|
523
|
+
* The built-in default STUN server is not added here; Connection falls back
|
|
524
|
+
* to it when the result has no STUN server.
|
|
525
|
+
*/
|
|
526
|
+
export declare function normalizeIceServerOptions(options: IceServerFields): {
|
|
527
|
+
stunServers: Address[];
|
|
528
|
+
turnServers: NormalizedTurnServer[];
|
|
529
|
+
};
|
|
530
|
+
/**
|
|
531
|
+
* `current` with an ICE server update applied (Connection.setIceServers): the
|
|
532
|
+
* STUN/TURN fields, singular and plural, are replaced, an undefined one
|
|
533
|
+
* included, so a STUN-only update cannot leave a previous TURN
|
|
534
|
+
* host/credential behind; forceTurn and useTcp change only when given.
|
|
535
|
+
*/
|
|
536
|
+
export declare function mergeIceServerOptions<T extends Partial<IceOptions>>(current: T, update: Partial<IceOptions>): T;
|
|
537
|
+
/**
|
|
538
|
+
* Whether a generation gathered with `options` is relay-only: forceTurn (the
|
|
539
|
+
* "relay" ICE transport policy). The policy holds whatever the TURN settings
|
|
540
|
+
* are: without a usable TURN server / credential (or for an ICE-lite agent,
|
|
541
|
+
* which gathers no relay candidate) the generation has no candidate at all
|
|
542
|
+
* rather than falling back to host / server-reflexive ones, so the local and
|
|
543
|
+
* public addresses are neither advertised nor used for checks.
|
|
544
|
+
*/
|
|
545
|
+
export declare function isRelayOnlyGathering(options: Pick<IceOptions, "forceTurn">): boolean;
|
|
546
|
+
/**
|
|
547
|
+
* Whether `options` carry at least one usable TURN server with its
|
|
548
|
+
* credential, the ones a gathering with them allocates relay candidates from.
|
|
549
|
+
*/
|
|
550
|
+
export declare function hasTurnServer(options: IceServerFields): boolean;
|
|
551
|
+
/**
|
|
552
|
+
* Whether `candidate`, kept from an earlier generation (an ICE restart keeps
|
|
553
|
+
* the sockets), may be advertised and paired in a generation gathered with
|
|
554
|
+
* `options`. A fresh gathering with the same options would not have produced
|
|
555
|
+
* a host / server-reflexive candidate for a relay-only policy, a TCP host
|
|
556
|
+
* candidate without useTcp, nor a relay candidate without a TURN server;
|
|
557
|
+
* the kept ones are held back the same way.
|
|
558
|
+
*/
|
|
559
|
+
export declare function isCandidateAllowedByGatherOptions(candidate: Pick<Candidate, "type" | "transport">, options: Pick<IceOptions, "forceTurn"> & Partial<Pick<IceOptions, "useTcp">> & IceServerFields): boolean;
|