@libp2p/webrtc 1.1.10 → 1.1.11
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 +15 -15
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/maconn.d.ts +2 -2
- package/dist/src/maconn.d.ts.map +1 -1
- package/dist/src/maconn.js +20 -8
- package/dist/src/maconn.js.map +1 -1
- package/dist/src/muxer.d.ts +3 -2
- package/dist/src/muxer.d.ts.map +1 -1
- package/dist/src/muxer.js +31 -17
- package/dist/src/muxer.js.map +1 -1
- package/dist/src/peer_transport/handler.d.ts +1 -1
- package/dist/src/peer_transport/handler.d.ts.map +1 -1
- package/dist/src/peer_transport/handler.js +6 -8
- package/dist/src/peer_transport/handler.js.map +1 -1
- package/dist/src/peer_transport/listener.d.ts +2 -2
- package/dist/src/peer_transport/listener.d.ts.map +1 -1
- package/dist/src/peer_transport/listener.js +2 -1
- package/dist/src/peer_transport/listener.js.map +1 -1
- package/dist/src/peer_transport/pb/index.d.ts +1 -1
- package/dist/src/peer_transport/pb/index.d.ts.map +1 -1
- package/dist/src/peer_transport/transport.d.ts +6 -7
- package/dist/src/peer_transport/transport.d.ts.map +1 -1
- package/dist/src/peer_transport/transport.js +10 -12
- package/dist/src/peer_transport/transport.js.map +1 -1
- package/dist/src/peer_transport/util.d.ts +1 -1
- package/dist/src/peer_transport/util.d.ts.map +1 -1
- package/dist/src/peer_transport/util.js +1 -1
- package/dist/src/peer_transport/util.js.map +1 -1
- package/dist/src/sdp.d.ts +1 -1
- package/dist/src/sdp.d.ts.map +1 -1
- package/dist/src/sdp.js.map +1 -1
- package/dist/src/stream.d.ts +5 -5
- package/dist/src/stream.d.ts.map +1 -1
- package/dist/src/stream.js +48 -25
- package/dist/src/stream.js.map +1 -1
- package/dist/src/transport.d.ts +4 -4
- package/dist/src/transport.d.ts.map +1 -1
- package/dist/src/transport.js +10 -10
- package/dist/src/transport.js.map +1 -1
- package/dist/src/util.d.ts +1 -3
- package/dist/src/util.d.ts.map +1 -1
- package/dist/src/util.js +1 -3
- package/dist/src/util.js.map +1 -1
- package/package.json +27 -29
- package/src/index.ts +3 -3
- package/src/maconn.ts +4 -5
- package/src/muxer.ts +5 -5
- package/src/peer_transport/handler.ts +7 -9
- package/src/peer_transport/listener.ts +3 -3
- package/src/peer_transport/pb/index.ts +1 -1
- package/src/peer_transport/transport.ts +13 -18
- package/src/peer_transport/util.ts +2 -2
- package/src/sdp.ts +2 -3
- package/src/stream.ts +6 -7
- package/src/transport.ts +11 -15
- package/src/util.ts +1 -3
package/src/transport.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { noise as Noise } from '@chainsafe/libp2p-noise'
|
|
2
|
-
import type
|
|
3
|
-
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
4
|
-
import { CreateListenerOptions, Listener, symbol, Transport } from '@libp2p/interface-transport'
|
|
2
|
+
import { type CreateListenerOptions, type Listener, symbol, type Transport } from '@libp2p/interface-transport'
|
|
5
3
|
import { logger } from '@libp2p/logger'
|
|
6
4
|
import * as p from '@libp2p/peer-id'
|
|
7
|
-
import
|
|
5
|
+
import { protocols } from '@multiformats/multiaddr'
|
|
8
6
|
import * as multihashes from 'multihashes'
|
|
9
|
-
import { fromString as uint8arrayFromString } from 'uint8arrays/from-string'
|
|
10
7
|
import { concat } from 'uint8arrays/concat'
|
|
8
|
+
import { fromString as uint8arrayFromString } from 'uint8arrays/from-string'
|
|
11
9
|
import { dataChannelError, inappropriateMultiaddr, unimplemented, invalidArgument } from './error.js'
|
|
12
10
|
import { WebRTCMultiaddrConnection } from './maconn.js'
|
|
13
11
|
import { DataChannelMuxerFactory } from './muxer.js'
|
|
14
|
-
import
|
|
12
|
+
import { isFirefox } from './peer_transport/util.js'
|
|
15
13
|
import * as sdp from './sdp.js'
|
|
16
14
|
import { WebRTCStream } from './stream.js'
|
|
17
15
|
import { genUfrag } from './util.js'
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
16
|
+
import type { WebRTCDialOptions } from './options.js'
|
|
17
|
+
import type { Connection } from '@libp2p/interface-connection'
|
|
18
|
+
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
19
|
+
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
20
20
|
|
|
21
21
|
const log = logger('libp2p:webrtc:transport')
|
|
22
22
|
|
|
@@ -83,16 +83,12 @@ export class WebRTCDirectTransport implements Transport {
|
|
|
83
83
|
/**
|
|
84
84
|
* Implement toString() for WebRTCTransport
|
|
85
85
|
*/
|
|
86
|
-
|
|
87
|
-
return '@libp2p/webrtc-direct'
|
|
88
|
-
}
|
|
86
|
+
readonly [Symbol.toStringTag] = '@libp2p/webrtc-direct'
|
|
89
87
|
|
|
90
88
|
/**
|
|
91
89
|
* Symbol.for('@libp2p/transport')
|
|
92
90
|
*/
|
|
93
|
-
|
|
94
|
-
return true
|
|
95
|
-
}
|
|
91
|
+
readonly [symbol] = true
|
|
96
92
|
|
|
97
93
|
/**
|
|
98
94
|
* Connect to a peer using a multiaddr
|
|
@@ -225,7 +221,7 @@ export class WebRTCDirectTransport implements Transport {
|
|
|
225
221
|
// Therefore, we need to secure an inbound noise connection from the remote.
|
|
226
222
|
await noise.secureInbound(myPeerId, wrappedDuplex, theirPeerId)
|
|
227
223
|
|
|
228
|
-
return
|
|
224
|
+
return options.upgrader.upgradeOutbound(maConn, { skipProtection: true, skipEncryption: true, muxerFactory })
|
|
229
225
|
}
|
|
230
226
|
|
|
231
227
|
/**
|