@libp2p/webrtc 6.0.16 → 6.0.18
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.js +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/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 -2
- 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/stream.ts +4 -4
- package/src/util.ts +1 -1
package/dist/src/constants.js
CHANGED
package/dist/src/index.d.ts
CHANGED
|
@@ -251,8 +251,8 @@
|
|
|
251
251
|
* // /ip4/...../udp/../webrtc-direct/certhash/foo
|
|
252
252
|
* ```
|
|
253
253
|
*/
|
|
254
|
-
import type { WebRTCTransportComponents, WebRTCTransportInit } from './private-to-private/transport.
|
|
255
|
-
import type { WebRTCTransportDirectInit, WebRTCDirectTransportComponents } from './private-to-public/transport.
|
|
254
|
+
import type { WebRTCTransportComponents, WebRTCTransportInit } from './private-to-private/transport.ts';
|
|
255
|
+
import type { WebRTCTransportDirectInit, WebRTCDirectTransportComponents } from './private-to-public/transport.ts';
|
|
256
256
|
import type { Transport } from '@libp2p/interface';
|
|
257
257
|
export interface DataChannelOptions {
|
|
258
258
|
/**
|
package/dist/src/index.js
CHANGED
|
@@ -251,8 +251,8 @@
|
|
|
251
251
|
* // /ip4/...../udp/../webrtc-direct/certhash/foo
|
|
252
252
|
* ```
|
|
253
253
|
*/
|
|
254
|
-
import { WebRTCTransport } from
|
|
255
|
-
import { WebRTCDirectTransport } from
|
|
254
|
+
import { WebRTCTransport } from "./private-to-private/transport.js";
|
|
255
|
+
import { WebRTCDirectTransport } from "./private-to-public/transport.js";
|
|
256
256
|
function webRTCDirect(init) {
|
|
257
257
|
return (components) => new WebRTCDirectTransport(components, init);
|
|
258
258
|
}
|
package/dist/src/muxer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractStreamMuxer } from '@libp2p/utils';
|
|
2
|
-
import { WebRTCStream } from './stream.
|
|
3
|
-
import type { DataChannelOptions } from './index.
|
|
2
|
+
import { WebRTCStream } from './stream.ts';
|
|
3
|
+
import type { DataChannelOptions } from './index.ts';
|
|
4
4
|
import type { ComponentLogger, CounterGroup, StreamMuxer, StreamMuxerFactory, CreateStreamOptions, MultiaddrConnection } from '@libp2p/interface';
|
|
5
5
|
export interface DataChannelMuxerFactoryInit {
|
|
6
6
|
/**
|
package/dist/src/muxer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractStreamMuxer } from '@libp2p/utils';
|
|
2
|
-
import { MUXER_PROTOCOL } from
|
|
3
|
-
import { createStream, WebRTCStream } from
|
|
2
|
+
import { MUXER_PROTOCOL } from "./constants.js";
|
|
3
|
+
import { createStream, WebRTCStream } from "./stream.js";
|
|
4
4
|
export class DataChannelMuxerFactory {
|
|
5
5
|
protocol;
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataChannelMuxerFactory } from '../muxer.js';
|
|
2
|
-
import type { WebRTCDialEvents, WebRTCTransportMetrics } from './transport.
|
|
2
|
+
import type { WebRTCDialEvents, WebRTCTransportMetrics } from './transport.ts';
|
|
3
3
|
import type { DataChannelOptions } from '../index.js';
|
|
4
4
|
import type { LoggerOptions, ComponentLogger, AbortOptions } from '@libp2p/interface';
|
|
5
5
|
import type { ConnectionManager, TransportManager } from '@libp2p/interface-internal';
|
|
@@ -5,9 +5,9 @@ import { SIGNALING_PROTOCOL } from '../constants.js';
|
|
|
5
5
|
import { SDPHandshakeFailedError } from '../error.js';
|
|
6
6
|
import { DataChannelMuxerFactory } from '../muxer.js';
|
|
7
7
|
import { RTCPeerConnection, RTCSessionDescription } from '../webrtc/index.js';
|
|
8
|
-
import { Message } from
|
|
9
|
-
import { splitAddr } from
|
|
10
|
-
import { readCandidatesUntilConnected } from
|
|
8
|
+
import { Message } from "./pb/message.js";
|
|
9
|
+
import { splitAddr } from "./transport.js";
|
|
10
|
+
import { readCandidatesUntilConnected } from "./util.js";
|
|
11
11
|
export async function initiateConnection({ rtcConfiguration, dataChannel, signal, metrics, multiaddr: ma, connectionManager, transportManager, log, logger, onProgress }) {
|
|
12
12
|
const { circuitAddress, targetPeer } = splitAddr(ma);
|
|
13
13
|
metrics?.dialerEvents.increment({ open: true });
|
|
@@ -2,8 +2,8 @@ import { pbStream } from '@libp2p/utils';
|
|
|
2
2
|
import { multiaddr } from '@multiformats/multiaddr';
|
|
3
3
|
import { SDPHandshakeFailedError } from '../error.js';
|
|
4
4
|
import { RTCSessionDescription } from '../webrtc/index.js';
|
|
5
|
-
import { Message } from
|
|
6
|
-
import { getRemotePeer, readCandidatesUntilConnected } from
|
|
5
|
+
import { Message } from "./pb/message.js";
|
|
6
|
+
import { getRemotePeer, readCandidatesUntilConnected } from "./util.js";
|
|
7
7
|
export async function handleIncomingStream(stream, connection, { peerConnection, signal, log }) {
|
|
8
8
|
log.trace('new inbound signaling stream');
|
|
9
9
|
const messageStream = pbStream(stream).pb(Message);
|
|
@@ -8,9 +8,9 @@ import { DataChannelMuxerFactory } from '../muxer.js';
|
|
|
8
8
|
import { toMultiaddrConnection } from "../rtcpeerconnection-to-conn.js";
|
|
9
9
|
import { getRtcConfiguration } from '../util.js';
|
|
10
10
|
import { RTCPeerConnection } from '../webrtc/index.js';
|
|
11
|
-
import { initiateConnection } from
|
|
12
|
-
import { WebRTCPeerListener } from
|
|
13
|
-
import { handleIncomingStream } from
|
|
11
|
+
import { initiateConnection } from "./initiate-connection.js";
|
|
12
|
+
import { WebRTCPeerListener } from "./listener.js";
|
|
13
|
+
import { handleIncomingStream } from "./signaling-stream-handler.js";
|
|
14
14
|
import { getRemotePeer } from "./util.js";
|
|
15
15
|
export class WebRTCTransport {
|
|
16
16
|
components;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Message } from './pb/message.
|
|
2
|
-
import type { WebRTCDialEvents } from './transport.
|
|
1
|
+
import { Message } from './pb/message.ts';
|
|
2
|
+
import type { WebRTCDialEvents } from './transport.ts';
|
|
3
3
|
import type { RTCPeerConnection } from '../webrtc/index.js';
|
|
4
4
|
import type { AbortOptions, LoggerOptions, PeerId, Stream } from '@libp2p/interface';
|
|
5
5
|
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
@@ -2,7 +2,7 @@ import { ConnectionFailedError, InvalidMessageError, InvalidMultiaddrError } fro
|
|
|
2
2
|
import { peerIdFromString } from '@libp2p/peer-id';
|
|
3
3
|
import { CustomProgressEvent } from 'progress-events';
|
|
4
4
|
import { RTCIceCandidate } from '../webrtc/index.js';
|
|
5
|
-
import { Message } from
|
|
5
|
+
import { Message } from "./pb/message.js";
|
|
6
6
|
export const readCandidatesUntilConnected = async (pc, stream, options) => {
|
|
7
7
|
try {
|
|
8
8
|
const connectedPromise = Promise.withResolvers();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TypedEventEmitter } from 'main-event';
|
|
2
2
|
import type { DataChannelOptions, TransportCertificate } from '../index.js';
|
|
3
|
-
import type { WebRTCDirectTransportCertificateEvents } from './transport.
|
|
3
|
+
import type { WebRTCDirectTransportCertificateEvents } from './transport.ts';
|
|
4
4
|
import type { PeerId, ListenerEvents, Listener, Upgrader, ComponentLogger, CounterGroup, Metrics, PrivateKey } from '@libp2p/interface';
|
|
5
5
|
import type { Keychain } from '@libp2p/keychain';
|
|
6
6
|
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
@@ -6,9 +6,9 @@ import { WebRTCDirect } from '@multiformats/multiaddr-matcher';
|
|
|
6
6
|
import getPort from 'get-port';
|
|
7
7
|
import { TypedEventEmitter, setMaxListeners } from 'main-event';
|
|
8
8
|
import pWaitFor from 'p-wait-for';
|
|
9
|
-
import { connect } from
|
|
10
|
-
import { createDialerRTCPeerConnection } from
|
|
11
|
-
import { stunListener } from
|
|
9
|
+
import { connect } from "./utils/connect.js";
|
|
10
|
+
import { createDialerRTCPeerConnection } from "./utils/get-rtcpeerconnection.js";
|
|
11
|
+
import { stunListener } from "./utils/stun-listener.js";
|
|
12
12
|
let UDP_MUX_LISTENERS = [];
|
|
13
13
|
export class WebRTCDirectListener extends TypedEventEmitter {
|
|
14
14
|
listeningMultiaddr;
|
|
@@ -4,8 +4,8 @@ import { CODE_P2P } from '@multiformats/multiaddr';
|
|
|
4
4
|
import { WebRTCDirect } from '@multiformats/multiaddr-matcher';
|
|
5
5
|
import { UnimplementedError } from "../error.js";
|
|
6
6
|
import { genUfrag } from '../util.js';
|
|
7
|
-
import { connect } from
|
|
8
|
-
import { createDialerRTCPeerConnection } from
|
|
7
|
+
import { connect } from "./utils/connect.js";
|
|
8
|
+
import { createDialerRTCPeerConnection } from "./utils/get-rtcpeerconnection.js";
|
|
9
9
|
export class WebRTCDirectTransport {
|
|
10
10
|
log;
|
|
11
11
|
metrics;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
1
2
|
import { X509Certificate } from '@peculiar/x509';
|
|
2
3
|
import { Key } from 'interface-datastore';
|
|
3
|
-
import { WebRTCDirectTransport as WebRTCDirectBrowserTransport } from './transport.browser.
|
|
4
|
+
import { WebRTCDirectTransport as WebRTCDirectBrowserTransport } from './transport.browser.ts';
|
|
4
5
|
import type { TransportCertificate } from '../index.js';
|
|
5
6
|
import type { WebRTCTransportDirectInit as WebRTCTransportDirectBrowserInit, WebRTCMetrics, WebRTCDirectTransportComponents } from './transport.browser.ts';
|
|
6
7
|
import type { CreateListenerOptions, Transport, Listener, Startable } from '@libp2p/interface';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/private-to-public/transport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/private-to-public/transport.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAIzB,OAAO,EAA6B,eAAe,EAA4B,MAAM,gBAAgB,CAAA;AACrG,OAA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IAIvB,IAAI,IAAK,OAAO,CAAC,IAAI,CAAC;IAQ5B;;OAEG;IACH,cAAc,CAAE,OAAO,EAAE,qBAAqB,GAAG,QAAQ;IAazD;;OAEG;IACH,YAAY,CAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE;IAInD;;OAEG;IACH,UAAU,CAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE;YAInC,cAAc;YAgBd,sBAAsB;YAmCtB,uBAAuB;IAuD/B,eAAe,CAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;IAiC9E,iBAAiB,CAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;IA6BtF,OAAO,CAAC,WAAW;CAKpB"}
|
|
@@ -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
|
|
13
|
-
import { WebRTCDirectTransport as WebRTCDirectBrowserTransport } from
|
|
14
|
-
import { formatAsPem } from
|
|
13
|
+
import { WebRTCDirectListener } from "./listener.js";
|
|
14
|
+
import { WebRTCDirectTransport as WebRTCDirectBrowserTransport } from "./transport.browser.js";
|
|
15
|
+
import { formatAsPem } from "./utils/pem.js";
|
|
15
16
|
export class WebRTCDirectTransport extends WebRTCDirectBrowserTransport {
|
|
16
17
|
certificate;
|
|
17
18
|
privateKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/private-to-public/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAChF,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AACrG,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,oCAAoC,EAAE,qCAAqC,EAAE,MAAM,iBAAiB,CAAA;AAC9K,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,qBAAqB,IAAI,4BAA4B,EAAE,MAAM,wBAAwB,CAAA;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAgE5C,MAAM,OAAO,qBAAsB,SAAQ,4BAA4B;IAC7D,WAAW,CAAuB;IAClC,UAAU,CAAa;IACd,OAAO,C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ACT,QAAQ;YACR,IAAI,EAAE,OAAO;YACb,UAAU,EAAE;gBACV,IAAI,yBAAyB,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC;aACtD;SACF,EAAE,MAAM,CAAC,CAAA;QAEV,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;YACzC,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACxF,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,mGAAmG,CAAC,CAAA;QAC/G,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAA;QACjC,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACZ,CAAC;CACF;AAED,SAAS,sBAAsB,CAAE,GAAS;IACxC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAChB,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAA;AAC9G,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataChannelMuxerFactory } from '../../muxer.js';
|
|
2
|
-
import type { DirectRTCPeerConnection } from './get-rtcpeerconnection.
|
|
2
|
+
import type { DirectRTCPeerConnection } from './get-rtcpeerconnection.ts';
|
|
3
3
|
import type { DataChannelOptions } from '../../index.js';
|
|
4
4
|
import type { ComponentLogger, Connection, CounterGroup, Logger, PeerId, PrivateKey, Upgrader } from '@libp2p/interface';
|
|
5
5
|
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
@@ -5,8 +5,8 @@ import { DataChannelMuxerFactory } from '../../muxer.js';
|
|
|
5
5
|
import { toMultiaddrConnection } from "../../rtcpeerconnection-to-conn.js";
|
|
6
6
|
import { createStream } from '../../stream.js';
|
|
7
7
|
import { isFirefox } from '../../util.js';
|
|
8
|
-
import { generateNoisePrologue } from
|
|
9
|
-
import * as sdp from
|
|
8
|
+
import { generateNoisePrologue } from "./generate-noise-prologue.js";
|
|
9
|
+
import * as sdp from "./sdp.js";
|
|
10
10
|
const CONNECTION_STATE_CHANGE_EVENT = isFirefox ? 'iceconnectionstatechange' : 'connectionstatechange';
|
|
11
11
|
function isServer(options, peerConnection) {
|
|
12
12
|
return options.role === 'server';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-certificates.d.ts","sourceRoot":"","sources":["../../../../src/private-to-public/utils/generate-certificates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-certificates.d.ts","sourceRoot":"","sources":["../../../../src/private-to-public/utils/generate-certificates.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAMzB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAO1D,MAAM,WAAW,mCAAmC;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,UAAU,CAAC,EAAE,GAAG,EAAE,CAAA;CACnB;AAED,wBAAsB,4BAA4B,CAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,mCAAmC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAgCvJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-certificates.js","sourceRoot":"","sources":["../../../../src/private-to-public/utils/generate-certificates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,KAAK,IAAI,MA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AAM,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;KACtF,CAAA;AACH,CAAC"}
|
|
@@ -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
|
|
5
|
+
import * as sdp from "./sdp.js";
|
|
6
6
|
const PREFIX = uint8arrayFromString('libp2p-webrtc-noise:');
|
|
7
7
|
/**
|
|
8
8
|
* Generate a noise prologue from the peer connection's certificate.
|
|
@@ -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.js";
|
|
6
|
-
import { generateTransportCertificate } from
|
|
6
|
+
import { generateTransportCertificate } from "./generate-certificates.js";
|
|
7
7
|
const crypto = new Crypto();
|
|
8
8
|
export class DirectRTCPeerConnection extends RTCPeerConnection {
|
|
9
9
|
peerConnection;
|
package/dist/src/stream.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractStream } from '@libp2p/utils';
|
|
2
2
|
import { Uint8ArrayList } from 'uint8arraylist';
|
|
3
|
-
import type { DataChannelOptions } from './index.
|
|
3
|
+
import type { DataChannelOptions } from './index.ts';
|
|
4
4
|
import type { AbortOptions, MessageStreamDirection, Logger } from '@libp2p/interface';
|
|
5
5
|
import type { AbstractStreamInit, SendResult } from '@libp2p/utils';
|
|
6
6
|
export interface WebRTCStreamInit extends AbstractStreamInit, DataChannelOptions {
|
package/dist/src/stream.js
CHANGED
|
@@ -5,9 +5,9 @@ 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
|
|
9
|
-
import { Message } from
|
|
10
|
-
import { isFirefox } from
|
|
8
|
+
import { DEFAULT_FIN_ACK_TIMEOUT, MAX_BUFFERED_AMOUNT, MAX_MESSAGE_SIZE, PROTOBUF_OVERHEAD } from "./constants.js";
|
|
9
|
+
import { Message } from "./private-to-public/pb/message.js";
|
|
10
|
+
import { isFirefox } from "./util.js";
|
|
11
11
|
export class WebRTCStream extends AbstractStream {
|
|
12
12
|
/**
|
|
13
13
|
* The data channel used to send and receive data
|
package/dist/src/util.js
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
|
|
4
|
+
import { DATA_CHANNEL_DRAIN_TIMEOUT, DEFAULT_ICE_SERVERS, UFRAG_ALPHABET, UFRAG_PREFIX } from "./constants.js";
|
|
5
5
|
const browser = detect();
|
|
6
6
|
export const isFirefox = ((browser != null) && browser.name === 'firefox');
|
|
7
7
|
export const nopSource = async function* nop() { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/webrtc",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.18",
|
|
4
4
|
"description": "A libp2p transport using WebRTC connections",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webrtc#readme",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
28
|
"types": "./dist/src/index.d.ts",
|
|
29
|
-
"import": "./dist/src/index.js"
|
|
29
|
+
"import": "./dist/src/index.js",
|
|
30
|
+
"module-sync": "./dist/src/index.js"
|
|
30
31
|
}
|
|
31
32
|
},
|
|
32
33
|
"scripts": {
|
|
@@ -45,17 +46,17 @@
|
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
48
|
"@chainsafe/is-ip": "^2.1.0",
|
|
48
|
-
"@libp2p/crypto": "^5.1.15",
|
|
49
|
-
"@libp2p/interface": "^3.2.0",
|
|
50
|
-
"@libp2p/interface-internal": "^3.1.0",
|
|
51
|
-
"@libp2p/keychain": "^6.0.12",
|
|
52
49
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
53
|
-
"@libp2p/
|
|
54
|
-
"@libp2p/
|
|
50
|
+
"@libp2p/crypto": "^5.1.17",
|
|
51
|
+
"@libp2p/interface": "^3.2.2",
|
|
52
|
+
"@libp2p/interface-internal": "^3.1.2",
|
|
53
|
+
"@libp2p/keychain": "^6.0.14",
|
|
54
|
+
"@libp2p/peer-id": "^6.0.8",
|
|
55
|
+
"@libp2p/utils": "^7.0.17",
|
|
55
56
|
"@multiformats/multiaddr": "^13.0.1",
|
|
56
57
|
"@multiformats/multiaddr-matcher": "^3.0.1",
|
|
57
58
|
"@peculiar/webcrypto": "^1.5.0",
|
|
58
|
-
"@peculiar/x509": "^
|
|
59
|
+
"@peculiar/x509": "^2.0.0",
|
|
59
60
|
"detect-browser": "^5.3.0",
|
|
60
61
|
"get-port": "^7.1.0",
|
|
61
62
|
"interface-datastore": "^9.0.1",
|
|
@@ -74,18 +75,19 @@
|
|
|
74
75
|
"protons-runtime": "^6.0.1",
|
|
75
76
|
"race-signal": "^2.0.0",
|
|
76
77
|
"react-native-webrtc": "^124.0.6",
|
|
78
|
+
"reflect-metadata": "^0.2.2",
|
|
77
79
|
"uint8-varint": "^2.0.4",
|
|
78
80
|
"uint8arraylist": "^2.4.8",
|
|
79
81
|
"uint8arrays": "^5.1.0"
|
|
80
82
|
},
|
|
81
83
|
"devDependencies": {
|
|
82
|
-
"@libp2p/logger": "^6.2.
|
|
83
|
-
"@types/sinon": "^
|
|
84
|
+
"@libp2p/logger": "^6.2.6",
|
|
85
|
+
"@types/sinon": "^21.0.1",
|
|
84
86
|
"aegir": "^47.0.22",
|
|
85
87
|
"any-signal": "^4.1.1",
|
|
86
88
|
"datastore-core": "^11.0.1",
|
|
87
89
|
"delay": "^7.0.0",
|
|
88
|
-
"p-retry": "^
|
|
90
|
+
"p-retry": "^8.0.0",
|
|
89
91
|
"protons": "^8.1.1",
|
|
90
92
|
"sinon": "^21.0.0",
|
|
91
93
|
"sinon-ts": "^2.0.0",
|
package/src/constants.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -252,10 +252,10 @@
|
|
|
252
252
|
* ```
|
|
253
253
|
*/
|
|
254
254
|
|
|
255
|
-
import { WebRTCTransport } from './private-to-private/transport.
|
|
256
|
-
import { WebRTCDirectTransport } from './private-to-public/transport.
|
|
257
|
-
import type { WebRTCTransportComponents, WebRTCTransportInit } from './private-to-private/transport.
|
|
258
|
-
import type { WebRTCTransportDirectInit, WebRTCDirectTransportComponents } from './private-to-public/transport.
|
|
255
|
+
import { WebRTCTransport } from './private-to-private/transport.ts'
|
|
256
|
+
import { WebRTCDirectTransport } from './private-to-public/transport.ts'
|
|
257
|
+
import type { WebRTCTransportComponents, WebRTCTransportInit } from './private-to-private/transport.ts'
|
|
258
|
+
import type { WebRTCTransportDirectInit, WebRTCDirectTransportComponents } from './private-to-public/transport.ts'
|
|
259
259
|
import type { Transport } from '@libp2p/interface'
|
|
260
260
|
|
|
261
261
|
export interface DataChannelOptions {
|
package/src/muxer.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractStreamMuxer } from '@libp2p/utils'
|
|
2
|
-
import { MUXER_PROTOCOL } from './constants.
|
|
3
|
-
import { createStream, WebRTCStream } from './stream.
|
|
4
|
-
import type { DataChannelOptions } from './index.
|
|
2
|
+
import { MUXER_PROTOCOL } from './constants.ts'
|
|
3
|
+
import { createStream, WebRTCStream } from './stream.ts'
|
|
4
|
+
import type { DataChannelOptions } from './index.ts'
|
|
5
5
|
import type { ComponentLogger, CounterGroup, StreamMuxer, StreamMuxerFactory, CreateStreamOptions, MultiaddrConnection } from '@libp2p/interface'
|
|
6
6
|
|
|
7
7
|
export interface DataChannelMuxerFactoryInit {
|
|
@@ -5,10 +5,10 @@ import { SIGNALING_PROTOCOL } from '../constants.js'
|
|
|
5
5
|
import { SDPHandshakeFailedError } from '../error.js'
|
|
6
6
|
import { DataChannelMuxerFactory } from '../muxer.js'
|
|
7
7
|
import { RTCPeerConnection, RTCSessionDescription } from '../webrtc/index.js'
|
|
8
|
-
import { Message } from './pb/message.
|
|
9
|
-
import { splitAddr } from './transport.
|
|
10
|
-
import { readCandidatesUntilConnected } from './util.
|
|
11
|
-
import type { WebRTCDialEvents, WebRTCTransportMetrics } from './transport.
|
|
8
|
+
import { Message } from './pb/message.ts'
|
|
9
|
+
import { splitAddr } from './transport.ts'
|
|
10
|
+
import { readCandidatesUntilConnected } from './util.ts'
|
|
11
|
+
import type { WebRTCDialEvents, WebRTCTransportMetrics } from './transport.ts'
|
|
12
12
|
import type { DataChannelOptions } from '../index.js'
|
|
13
13
|
import type { LoggerOptions, Connection, ComponentLogger, AbortOptions } from '@libp2p/interface'
|
|
14
14
|
import type { ConnectionManager, TransportManager } from '@libp2p/interface-internal'
|
|
@@ -2,8 +2,8 @@ import { pbStream } from '@libp2p/utils'
|
|
|
2
2
|
import { multiaddr } from '@multiformats/multiaddr'
|
|
3
3
|
import { SDPHandshakeFailedError } from '../error.js'
|
|
4
4
|
import { RTCSessionDescription } from '../webrtc/index.js'
|
|
5
|
-
import { Message } from './pb/message.
|
|
6
|
-
import { getRemotePeer, readCandidatesUntilConnected } from './util.
|
|
5
|
+
import { Message } from './pb/message.ts'
|
|
6
|
+
import { getRemotePeer, readCandidatesUntilConnected } from './util.ts'
|
|
7
7
|
import type { RTCPeerConnection } from '../webrtc/index.js'
|
|
8
8
|
import type { AbortOptions, Connection, Logger, PeerId, Stream } from '@libp2p/interface'
|
|
9
9
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
@@ -8,9 +8,9 @@ import { DataChannelMuxerFactory } from '../muxer.js'
|
|
|
8
8
|
import { toMultiaddrConnection } from '../rtcpeerconnection-to-conn.ts'
|
|
9
9
|
import { getRtcConfiguration } from '../util.js'
|
|
10
10
|
import { RTCPeerConnection } from '../webrtc/index.js'
|
|
11
|
-
import { initiateConnection } from './initiate-connection.
|
|
12
|
-
import { WebRTCPeerListener } from './listener.
|
|
13
|
-
import { handleIncomingStream } from './signaling-stream-handler.
|
|
11
|
+
import { initiateConnection } from './initiate-connection.ts'
|
|
12
|
+
import { WebRTCPeerListener } from './listener.ts'
|
|
13
|
+
import { handleIncomingStream } from './signaling-stream-handler.ts'
|
|
14
14
|
import { getRemotePeer } from './util.ts'
|
|
15
15
|
import type { DataChannelOptions } from '../index.js'
|
|
16
16
|
import type { OutboundConnectionUpgradeEvents, CreateListenerOptions, DialTransportOptions, Transport, Listener, Upgrader, ComponentLogger, Logger, Connection, PeerId, CounterGroup, Metrics, Startable, OpenConnectionProgressEvents, Libp2pEvents, MultiaddrConnection, Stream } from '@libp2p/interface'
|
|
@@ -2,8 +2,8 @@ import { ConnectionFailedError, InvalidMessageError, InvalidMultiaddrError } fro
|
|
|
2
2
|
import { peerIdFromString } from '@libp2p/peer-id'
|
|
3
3
|
import { CustomProgressEvent } from 'progress-events'
|
|
4
4
|
import { RTCIceCandidate } from '../webrtc/index.js'
|
|
5
|
-
import { Message } from './pb/message.
|
|
6
|
-
import type { WebRTCDialEvents } from './transport.
|
|
5
|
+
import { Message } from './pb/message.ts'
|
|
6
|
+
import type { WebRTCDialEvents } from './transport.ts'
|
|
7
7
|
import type { RTCPeerConnection } from '../webrtc/index.js'
|
|
8
8
|
import type { AbortOptions, LoggerOptions, PeerId, Stream } from '@libp2p/interface'
|
|
9
9
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
@@ -6,13 +6,13 @@ import { WebRTCDirect } from '@multiformats/multiaddr-matcher'
|
|
|
6
6
|
import getPort from 'get-port'
|
|
7
7
|
import { TypedEventEmitter, setMaxListeners } from 'main-event'
|
|
8
8
|
import pWaitFor from 'p-wait-for'
|
|
9
|
-
import { connect } from './utils/connect.
|
|
10
|
-
import { createDialerRTCPeerConnection } from './utils/get-rtcpeerconnection.
|
|
11
|
-
import { stunListener } from './utils/stun-listener.
|
|
9
|
+
import { connect } from './utils/connect.ts'
|
|
10
|
+
import { createDialerRTCPeerConnection } from './utils/get-rtcpeerconnection.ts'
|
|
11
|
+
import { stunListener } from './utils/stun-listener.ts'
|
|
12
12
|
import type { DataChannelOptions, TransportCertificate } from '../index.js'
|
|
13
|
-
import type { WebRTCDirectTransportCertificateEvents } from './transport.
|
|
14
|
-
import type { DirectRTCPeerConnection } from './utils/get-rtcpeerconnection.
|
|
15
|
-
import type { StunServer } from './utils/stun-listener.
|
|
13
|
+
import type { WebRTCDirectTransportCertificateEvents } from './transport.ts'
|
|
14
|
+
import type { DirectRTCPeerConnection } from './utils/get-rtcpeerconnection.ts'
|
|
15
|
+
import type { StunServer } from './utils/stun-listener.ts'
|
|
16
16
|
import type { PeerId, ListenerEvents, Listener, Upgrader, ComponentLogger, Logger, CounterGroup, Metrics, PrivateKey } from '@libp2p/interface'
|
|
17
17
|
import type { Keychain } from '@libp2p/keychain'
|
|
18
18
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
@@ -4,8 +4,8 @@ import { CODE_P2P } from '@multiformats/multiaddr'
|
|
|
4
4
|
import { WebRTCDirect } from '@multiformats/multiaddr-matcher'
|
|
5
5
|
import { UnimplementedError } from '../error.ts'
|
|
6
6
|
import { genUfrag } from '../util.js'
|
|
7
|
-
import { connect } from './utils/connect.
|
|
8
|
-
import { createDialerRTCPeerConnection } from './utils/get-rtcpeerconnection.
|
|
7
|
+
import { connect } from './utils/connect.ts'
|
|
8
|
+
import { createDialerRTCPeerConnection } from './utils/get-rtcpeerconnection.ts'
|
|
9
9
|
import type { DataChannelOptions } from '../index.js'
|
|
10
10
|
import type { WebRTCDialEvents } from '../private-to-private/transport.js'
|
|
11
11
|
import type { CreateListenerOptions, Transport, Listener, ComponentLogger, Logger, Connection, CounterGroup, Metrics, PeerId, DialTransportOptions, PrivateKey, Upgrader } from '@libp2p/interface'
|
|
@@ -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'
|