@libp2p/webrtc 5.2.12-f1de46607 → 5.2.13-aa25d38ab
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 +11 -11
- package/dist/index.min.js.map +4 -4
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/private-to-private/initiate-connection.d.ts +1 -1
- package/dist/src/private-to-private/initiate-connection.d.ts.map +1 -1
- package/dist/src/private-to-private/initiate-connection.js.map +1 -1
- package/dist/src/private-to-private/pb/message.d.ts +1 -1
- package/dist/src/private-to-private/pb/message.d.ts.map +1 -1
- package/dist/src/private-to-private/pb/message.js +0 -5
- package/dist/src/private-to-private/pb/message.js.map +1 -1
- package/dist/src/private-to-private/signaling-stream-handler.d.ts +2 -2
- package/dist/src/private-to-private/signaling-stream-handler.d.ts.map +1 -1
- package/dist/src/private-to-private/signaling-stream-handler.js.map +1 -1
- package/dist/src/private-to-private/transport.d.ts +1 -1
- package/dist/src/private-to-private/transport.d.ts.map +1 -1
- package/dist/src/private-to-private/transport.js.map +1 -1
- package/dist/src/private-to-private/util.d.ts.map +1 -1
- package/dist/src/private-to-public/listener.d.ts.map +1 -1
- package/dist/src/private-to-public/listener.js +2 -1
- package/dist/src/private-to-public/listener.js.map +1 -1
- package/dist/src/private-to-public/pb/message.d.ts +1 -1
- package/dist/src/private-to-public/pb/message.d.ts.map +1 -1
- package/dist/src/private-to-public/pb/message.js +0 -5
- package/dist/src/private-to-public/pb/message.js.map +1 -1
- package/dist/src/private-to-public/utils/generate-certificates.d.ts +1 -1
- package/dist/src/private-to-public/utils/generate-certificates.d.ts.map +1 -1
- package/dist/src/private-to-public/utils/pem.d.ts +0 -2
- package/dist/src/private-to-public/utils/pem.d.ts.map +1 -1
- package/dist/src/private-to-public/utils/stun-listener.d.ts +0 -1
- package/dist/src/private-to-public/utils/stun-listener.d.ts.map +1 -1
- package/dist/src/stream.d.ts +2 -1
- package/dist/src/stream.d.ts.map +1 -1
- package/dist/src/stream.js.map +1 -1
- package/dist/src/util.d.ts.map +1 -1
- package/dist/src/webrtc/index.browser.d.ts +2 -2
- package/package.json +24 -31
- package/src/index.ts +2 -1
- package/src/private-to-private/initiate-connection.ts +2 -1
- package/src/private-to-private/pb/message.ts +2 -7
- package/src/private-to-private/signaling-stream-handler.ts +4 -2
- package/src/private-to-private/transport.ts +2 -1
- package/src/private-to-public/listener.ts +2 -1
- package/src/private-to-public/pb/message.ts +2 -7
- package/src/private-to-public/utils/generate-certificates.ts +1 -1
- package/src/stream.ts +4 -2
@@ -7,8 +7,9 @@ import { SDPHandshakeFailedError } from '../error.js'
|
|
7
7
|
import { DataChannelMuxerFactory } from '../muxer.js'
|
8
8
|
import { RTCPeerConnection, RTCSessionDescription } from '../webrtc/index.js'
|
9
9
|
import { Message } from './pb/message.js'
|
10
|
-
import { splitAddr
|
10
|
+
import { splitAddr } from './transport.js'
|
11
11
|
import { readCandidatesUntilConnected } from './util.js'
|
12
|
+
import type { WebRTCDialEvents, WebRTCTransportMetrics } from './transport.js'
|
12
13
|
import type { DataChannelOptions } from '../index.js'
|
13
14
|
import type { LoggerOptions, Connection, ComponentLogger, IncomingStreamData } from '@libp2p/interface'
|
14
15
|
import type { ConnectionManager, TransportManager } from '@libp2p/interface-internal'
|
@@ -1,10 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
/* eslint-disable @typescript-eslint/no-namespace */
|
4
|
-
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
5
|
-
/* eslint-disable @typescript-eslint/no-empty-interface */
|
6
|
-
|
7
|
-
import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, enumeration, message } from 'protons-runtime'
|
1
|
+
import { decodeMessage, encodeMessage, enumeration, message } from 'protons-runtime'
|
2
|
+
import type { Codec, DecodeOptions } from 'protons-runtime'
|
8
3
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
9
4
|
|
10
5
|
export interface Message {
|
@@ -1,10 +1,12 @@
|
|
1
|
-
import { multiaddr
|
1
|
+
import { multiaddr } from '@multiformats/multiaddr'
|
2
2
|
import { pbStream } from 'it-protobuf-stream'
|
3
3
|
import { SDPHandshakeFailedError } from '../error.js'
|
4
|
-
import {
|
4
|
+
import { RTCSessionDescription } from '../webrtc/index.js'
|
5
5
|
import { Message } from './pb/message.js'
|
6
6
|
import { getConnectionState, readCandidatesUntilConnected } from './util.js'
|
7
|
+
import type { RTCPeerConnection } from '../webrtc/index.js'
|
7
8
|
import type { Logger, IncomingStreamData } from '@libp2p/interface'
|
9
|
+
import type { Multiaddr } from '@multiformats/multiaddr'
|
8
10
|
|
9
11
|
export interface IncomingStreamOpts extends IncomingStreamData {
|
10
12
|
peerConnection: RTCPeerConnection
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { InvalidParametersError, serviceCapabilities, serviceDependencies, setMaxListeners, transportSymbol } from '@libp2p/interface'
|
2
2
|
import { peerIdFromString } from '@libp2p/peer-id'
|
3
|
-
import { multiaddr
|
3
|
+
import { multiaddr } from '@multiformats/multiaddr'
|
4
4
|
import { WebRTC } from '@multiformats/multiaddr-matcher'
|
5
5
|
import { SIGNALING_PROTOCOL } from '../constants.js'
|
6
6
|
import { WebRTCMultiaddrConnection } from '../maconn.js'
|
@@ -13,6 +13,7 @@ import { handleIncomingStream } from './signaling-stream-handler.js'
|
|
13
13
|
import type { DataChannelOptions } from '../index.js'
|
14
14
|
import type { OutboundConnectionUpgradeEvents, CreateListenerOptions, DialTransportOptions, Transport, Listener, Upgrader, ComponentLogger, Logger, Connection, PeerId, CounterGroup, Metrics, Startable, OpenConnectionProgressEvents, IncomingStreamData, Libp2pEvents, TypedEventTarget } from '@libp2p/interface'
|
15
15
|
import type { Registrar, ConnectionManager, TransportManager } from '@libp2p/interface-internal'
|
16
|
+
import type { Multiaddr } from '@multiformats/multiaddr'
|
16
17
|
import type { ProgressEvent } from 'progress-events'
|
17
18
|
|
18
19
|
export interface WebRTCTransportInit {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { isIPv4 } from '@chainsafe/is-ip'
|
2
|
-
import { InvalidParametersError, TypedEventEmitter } from '@libp2p/interface'
|
2
|
+
import { InvalidParametersError, TypedEventEmitter, setMaxListeners } from '@libp2p/interface'
|
3
3
|
import { getThinWaistAddresses } from '@libp2p/utils/get-thin-waist-addresses'
|
4
4
|
import { multiaddr, fromStringTuples } from '@multiformats/multiaddr'
|
5
5
|
import { WebRTCDirect } from '@multiformats/multiaddr-matcher'
|
@@ -71,6 +71,7 @@ export class WebRTCDirectListener extends TypedEventEmitter<ListenerEvents> impl
|
|
71
71
|
this.connections = new Map()
|
72
72
|
this.log = components.logger.forComponent('libp2p:webrtc-direct:listener')
|
73
73
|
this.shutdownController = new AbortController()
|
74
|
+
setMaxListeners(Infinity, this.shutdownController.signal)
|
74
75
|
this.certificate = init.certificate
|
75
76
|
|
76
77
|
if (components.metrics != null) {
|
@@ -1,10 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
/* eslint-disable @typescript-eslint/no-namespace */
|
4
|
-
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
5
|
-
/* eslint-disable @typescript-eslint/no-empty-interface */
|
6
|
-
|
7
|
-
import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, enumeration, message } from 'protons-runtime'
|
1
|
+
import { decodeMessage, encodeMessage, enumeration, message } from 'protons-runtime'
|
2
|
+
import type { Codec, DecodeOptions } from 'protons-runtime'
|
8
3
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
9
4
|
|
10
5
|
export interface Message {
|
@@ -3,7 +3,7 @@ import * as x509 from '@peculiar/x509'
|
|
3
3
|
import { base64url } from 'multiformats/bases/base64'
|
4
4
|
import { sha256 } from 'multiformats/hashes/sha2'
|
5
5
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
|
6
|
-
import type { TransportCertificate } from '
|
6
|
+
import type { TransportCertificate } from '../../index.js'
|
7
7
|
|
8
8
|
const crypto = new Crypto()
|
9
9
|
x509.cryptoProvider.set(crypto)
|
package/src/stream.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { StreamStateError, TimeoutError } from '@libp2p/interface'
|
2
|
-
import { AbstractStream
|
2
|
+
import { AbstractStream } from '@libp2p/utils/abstract-stream'
|
3
3
|
import { anySignal } from 'any-signal'
|
4
4
|
import * as lengthPrefixed from 'it-length-prefixed'
|
5
|
-
import {
|
5
|
+
import { pushable } from 'it-pushable'
|
6
6
|
import pDefer from 'p-defer'
|
7
7
|
import pTimeout from 'p-timeout'
|
8
8
|
import { raceEvent } from 'race-event'
|
@@ -12,6 +12,8 @@ import { BUFFERED_AMOUNT_LOW_TIMEOUT, FIN_ACK_TIMEOUT, MAX_BUFFERED_AMOUNT, MAX_
|
|
12
12
|
import { Message } from './private-to-public/pb/message.js'
|
13
13
|
import type { DataChannelOptions } from './index.js'
|
14
14
|
import type { AbortOptions, ComponentLogger, Direction } from '@libp2p/interface'
|
15
|
+
import type { AbstractStreamInit } from '@libp2p/utils/abstract-stream'
|
16
|
+
import type { Pushable } from 'it-pushable'
|
15
17
|
import type { DeferredPromise } from 'p-defer'
|
16
18
|
|
17
19
|
export interface WebRTCStreamInit extends AbstractStreamInit, DataChannelOptions {
|