@libp2p/webrtc 6.0.16 → 6.0.18-48f66c41e
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/dist/index.min.js +12 -15
- package/dist/index.min.js.map +4 -4
- package/dist/src/constants.js +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +2 -2
- package/dist/src/muxer.d.ts +2 -2
- package/dist/src/muxer.js +2 -2
- package/dist/src/private-to-private/initiate-connection.d.ts +1 -1
- package/dist/src/private-to-private/initiate-connection.js +3 -3
- package/dist/src/private-to-private/signaling-stream-handler.js +2 -2
- package/dist/src/private-to-private/transport.js +3 -3
- package/dist/src/private-to-private/util.d.ts +2 -2
- package/dist/src/private-to-private/util.d.ts.map +1 -1
- package/dist/src/private-to-private/util.js +1 -2
- package/dist/src/private-to-private/util.js.map +1 -1
- package/dist/src/private-to-public/listener.d.ts +1 -1
- package/dist/src/private-to-public/listener.js +3 -3
- package/dist/src/private-to-public/transport.browser.js +2 -2
- package/dist/src/private-to-public/transport.d.ts +2 -1
- package/dist/src/private-to-public/transport.d.ts.map +1 -1
- package/dist/src/private-to-public/transport.js +4 -3
- package/dist/src/private-to-public/transport.js.map +1 -1
- package/dist/src/private-to-public/utils/connect.d.ts +1 -1
- package/dist/src/private-to-public/utils/connect.js +2 -2
- package/dist/src/private-to-public/utils/generate-certificates.d.ts +1 -0
- package/dist/src/private-to-public/utils/generate-certificates.d.ts.map +1 -1
- package/dist/src/private-to-public/utils/generate-certificates.js +1 -0
- package/dist/src/private-to-public/utils/generate-certificates.js.map +1 -1
- package/dist/src/private-to-public/utils/generate-noise-prologue.js +1 -1
- package/dist/src/private-to-public/utils/get-rtcpeerconnection.js +1 -1
- package/dist/src/rtcpeerconnection-to-conn.js +1 -1
- package/dist/src/rtcpeerconnection-to-conn.js.map +1 -1
- package/dist/src/stream.d.ts +1 -1
- package/dist/src/stream.js +3 -3
- package/dist/src/util.js +1 -1
- package/package.json +14 -12
- package/src/constants.ts +1 -1
- package/src/index.ts +4 -4
- package/src/muxer.ts +3 -3
- package/src/private-to-private/initiate-connection.ts +4 -4
- package/src/private-to-private/signaling-stream-handler.ts +2 -2
- package/src/private-to-private/transport.ts +3 -3
- package/src/private-to-private/util.ts +2 -3
- package/src/private-to-public/listener.ts +6 -6
- package/src/private-to-public/transport.browser.ts +2 -2
- package/src/private-to-public/transport.ts +4 -3
- package/src/private-to-public/utils/connect.ts +3 -3
- package/src/private-to-public/utils/generate-certificates.ts +1 -0
- package/src/private-to-public/utils/generate-noise-prologue.ts +1 -1
- package/src/private-to-public/utils/get-rtcpeerconnection.ts +1 -1
- package/src/rtcpeerconnection-to-conn.ts +1 -1
- package/src/stream.ts +4 -4
- package/src/util.ts +1 -1
- package/dist/typedoc-urls.json +0 -14
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import 'reflect-metadata'
|
|
1
2
|
import { generateKeyPair, privateKeyToCryptoKeyPair } from '@libp2p/crypto/keys'
|
|
2
3
|
import { InvalidParametersError, NotFoundError, NotStartedError } from '@libp2p/interface'
|
|
3
4
|
import { WebRTCDirect } from '@multiformats/multiaddr-matcher'
|
|
@@ -9,9 +10,9 @@ import { sha256 } from 'multiformats/hashes/sha2'
|
|
|
9
10
|
import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
|
|
10
11
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
11
12
|
import { DEFAULT_CERTIFICATE_DATASTORE_KEY, DEFAULT_CERTIFICATE_LIFESPAN, DEFAULT_CERTIFICATE_PRIVATE_KEY_NAME, DEFAULT_CERTIFICATE_RENEWAL_THRESHOLD } from '../constants.js'
|
|
12
|
-
import { WebRTCDirectListener } from './listener.
|
|
13
|
-
import { WebRTCDirectTransport as WebRTCDirectBrowserTransport } from './transport.browser.
|
|
14
|
-
import { formatAsPem } from './utils/pem.
|
|
13
|
+
import { WebRTCDirectListener } from './listener.ts'
|
|
14
|
+
import { WebRTCDirectTransport as WebRTCDirectBrowserTransport } from './transport.browser.ts'
|
|
15
|
+
import { formatAsPem } from './utils/pem.ts'
|
|
15
16
|
import type { TransportCertificate } from '../index.js'
|
|
16
17
|
import type { WebRTCTransportDirectInit as WebRTCTransportDirectBrowserInit, WebRTCMetrics, WebRTCDirectTransportComponents } from './transport.browser.ts'
|
|
17
18
|
import type { CreateListenerOptions, Transport, Listener, PrivateKey, Startable } from '@libp2p/interface'
|
|
@@ -5,9 +5,9 @@ import { DataChannelMuxerFactory } from '../../muxer.js'
|
|
|
5
5
|
import { toMultiaddrConnection } from '../../rtcpeerconnection-to-conn.ts'
|
|
6
6
|
import { createStream } from '../../stream.js'
|
|
7
7
|
import { isFirefox } from '../../util.js'
|
|
8
|
-
import { generateNoisePrologue } from './generate-noise-prologue.
|
|
9
|
-
import * as sdp from './sdp.
|
|
10
|
-
import type { DirectRTCPeerConnection } from './get-rtcpeerconnection.
|
|
8
|
+
import { generateNoisePrologue } from './generate-noise-prologue.ts'
|
|
9
|
+
import * as sdp from './sdp.ts'
|
|
10
|
+
import type { DirectRTCPeerConnection } from './get-rtcpeerconnection.ts'
|
|
11
11
|
import type { DataChannelOptions } from '../../index.js'
|
|
12
12
|
import type { ComponentLogger, Connection, CounterGroup, Logger, PeerId, PrivateKey, Upgrader } from '@libp2p/interface'
|
|
13
13
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
@@ -2,7 +2,7 @@ import * as Digest from 'multiformats/hashes/digest'
|
|
|
2
2
|
import { sha256 } from 'multiformats/hashes/sha2'
|
|
3
3
|
import { concat } from 'uint8arrays/concat'
|
|
4
4
|
import { fromString as uint8arrayFromString } from 'uint8arrays/from-string'
|
|
5
|
-
import * as sdp from './sdp.
|
|
5
|
+
import * as sdp from './sdp.ts'
|
|
6
6
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
7
7
|
|
|
8
8
|
const PREFIX = uint8arrayFromString('libp2p-webrtc-noise:')
|
|
@@ -3,7 +3,7 @@ import { PeerConnection } from 'node-datachannel'
|
|
|
3
3
|
import { RTCPeerConnection } from 'node-datachannel/polyfill'
|
|
4
4
|
import { DEFAULT_ICE_SERVERS, MAX_MESSAGE_SIZE } from '../../constants.js'
|
|
5
5
|
import { DataChannelMuxerFactory } from '../../muxer.ts'
|
|
6
|
-
import { generateTransportCertificate } from './generate-certificates.
|
|
6
|
+
import { generateTransportCertificate } from './generate-certificates.ts'
|
|
7
7
|
import type { DataChannelOptions, TransportCertificate } from '../../index.js'
|
|
8
8
|
import type { CounterGroup } from '@libp2p/interface'
|
|
9
9
|
import type { CertificateFingerprint } from 'node-datachannel'
|
|
@@ -20,7 +20,7 @@ class RTCPeerConnectionMultiaddrConnection extends AbstractMultiaddrConnection {
|
|
|
20
20
|
this.peerConnection.onconnectionstatechange = () => {
|
|
21
21
|
this.log.trace('peer connection state change %s initial state %s', this.peerConnection.connectionState, initialState)
|
|
22
22
|
|
|
23
|
-
if (this.peerConnection.connectionState === '
|
|
23
|
+
if (this.peerConnection.connectionState === 'failed' || this.peerConnection.connectionState === 'closed') {
|
|
24
24
|
// nothing else to do but close the connection
|
|
25
25
|
this.onTransportClosed()
|
|
26
26
|
|
package/src/stream.ts
CHANGED
|
@@ -5,10 +5,10 @@ import { pushable } from 'it-pushable'
|
|
|
5
5
|
import { pEvent } from 'p-event'
|
|
6
6
|
import { raceSignal } from 'race-signal'
|
|
7
7
|
import { Uint8ArrayList } from 'uint8arraylist'
|
|
8
|
-
import { DEFAULT_FIN_ACK_TIMEOUT, MAX_BUFFERED_AMOUNT, MAX_MESSAGE_SIZE, PROTOBUF_OVERHEAD } from './constants.
|
|
9
|
-
import { Message } from './private-to-public/pb/message.
|
|
10
|
-
import { isFirefox } from './util.
|
|
11
|
-
import type { DataChannelOptions } from './index.
|
|
8
|
+
import { DEFAULT_FIN_ACK_TIMEOUT, MAX_BUFFERED_AMOUNT, MAX_MESSAGE_SIZE, PROTOBUF_OVERHEAD } from './constants.ts'
|
|
9
|
+
import { Message } from './private-to-public/pb/message.ts'
|
|
10
|
+
import { isFirefox } from './util.ts'
|
|
11
|
+
import type { DataChannelOptions } from './index.ts'
|
|
12
12
|
import type { AbortOptions, MessageStreamDirection, Logger } from '@libp2p/interface'
|
|
13
13
|
import type { AbstractStreamInit, SendResult } from '@libp2p/utils'
|
|
14
14
|
import type { Pushable } from 'it-pushable'
|
package/src/util.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { detect } from 'detect-browser'
|
|
2
2
|
import pDefer from 'p-defer'
|
|
3
3
|
import pTimeout from 'p-timeout'
|
|
4
|
-
import { DATA_CHANNEL_DRAIN_TIMEOUT, DEFAULT_ICE_SERVERS, UFRAG_ALPHABET, UFRAG_PREFIX } from './constants.
|
|
4
|
+
import { DATA_CHANNEL_DRAIN_TIMEOUT, DEFAULT_ICE_SERVERS, UFRAG_ALPHABET, UFRAG_PREFIX } from './constants.ts'
|
|
5
5
|
import type { LoggerOptions } from '@libp2p/interface'
|
|
6
6
|
import type { Duplex, Source } from 'it-stream-types'
|
|
7
7
|
import type { PeerConnection } from 'node-datachannel'
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"DataChannelOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.DataChannelOptions.html",
|
|
3
|
-
".:DataChannelOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.DataChannelOptions.html",
|
|
4
|
-
"TransportCertificate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.TransportCertificate.html",
|
|
5
|
-
".:TransportCertificate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.TransportCertificate.html",
|
|
6
|
-
"WebRTCDirectTransportComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.WebRTCDirectTransportComponents.html",
|
|
7
|
-
"WebRTCTransportComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.WebRTCTransportComponents.html",
|
|
8
|
-
"WebRTCTransportDirectInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.WebRTCTransportDirectInit.html",
|
|
9
|
-
"WebRTCTransportInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.WebRTCTransportInit.html",
|
|
10
|
-
"webRTC": "https://libp2p.github.io/js-libp2p/functions/_libp2p_webrtc.webRTC.html",
|
|
11
|
-
".:webRTC": "https://libp2p.github.io/js-libp2p/functions/_libp2p_webrtc.webRTC.html",
|
|
12
|
-
"webRTCDirect": "https://libp2p.github.io/js-libp2p/functions/_libp2p_webrtc.webRTCDirect.html",
|
|
13
|
-
".:webRTCDirect": "https://libp2p.github.io/js-libp2p/functions/_libp2p_webrtc.webRTCDirect.html"
|
|
14
|
-
}
|