@@ -6,13 +6,10 @@ import { noise } from '@chainsafe/libp2p-noise'
6
6
import { yamux } from '@chainsafe/libp2p-yamux'
7
7
import { mplex } from '@libp2p/mplex'
8
8
import { tcp } from '@libp2p/tcp'
9
- import { webRTC , webRTCDirect } from '@libp2p/webrtc'
10
9
import { webSockets } from '@libp2p/websockets'
11
- import * as filters from '@libp2p/websockets/filters'
12
10
import { webTransport } from '@libp2p/webtransport'
13
11
import { type Multiaddr , multiaddr } from '@multiformats/multiaddr'
14
12
import { createLibp2p , type Libp2p , type Libp2pOptions } from 'libp2p'
15
- import { circuitRelayTransport } from 'libp2p/circuit-relay'
16
13
import { type IdentifyService , identifyService } from 'libp2p/identify'
17
14
import { pingService , type PingService } from 'libp2p/ping'
18
15
@@ -67,32 +64,34 @@ describe('ping test', function () {
67
64
throw new Error ( 'WebTransport is not supported as a listener' )
68
65
}
69
66
break
70
- case 'webrtc-direct' :
71
- options . transports = [ webRTCDirect ( ) ]
72
- options . addresses = {
73
- listen : isDialer ? [ ] : [ `/ip4/${ IP } /udp/0/webrtc-direct` ]
74
- }
75
- break
76
- case 'webrtc' :
77
- options . transports = [ webRTC ( ) ,
78
- webSockets ( { filter : filters . all } ) , // ws needed to connect to relay
79
- circuitRelayTransport ( {
80
- discoverRelays : 1
81
- } ) // needed to use the relay
82
- ]
83
- options . addresses = {
84
- listen : isDialer ? [ ] : [ '/webrtc' ]
85
- }
86
- options . connectionGater = {
87
- denyDialMultiaddr : ( ) => {
88
- // by default we refuse to dial local addresses from the browser since they
89
- // are usually sent by remote peers broadcasting undialable multiaddrs but
90
- // here we are explicitly connecting to a local node so do not deny dialing
91
- // any discovered address
92
- return false
93
- }
94
- }
95
- break
67
+ //
68
+ // #TODO: We can re-introduce this once https://github.com/libp2p/js-libp2p/issues/1846 is resolved
69
+ // case 'webrtc-direct':
70
+ // options.transports = [webRTCDirect()]
71
+ // options.addresses = {
72
+ // listen: isDialer ? [] : [`/ip4/${IP}/udp/0/webrtc-direct`]
73
+ // }
74
+ // break
75
+ // case 'webrtc':
76
+ // options.transports = [webRTC(),
77
+ // webSockets({ filter: filters.all }), // ws needed to connect to relay
78
+ // circuitRelayTransport({
79
+ // discoverRelays: 1
80
+ // }) // needed to use the relay
81
+ // ]
82
+ // options.addresses = {
83
+ // listen: isDialer ? [] : ['/webrtc']
84
+ // }
85
+ // options.connectionGater = {
86
+ // denyDialMultiaddr: () => {
87
+ // // by default we refuse to dial local addresses from the browser since they
88
+ // // are usually sent by remote peers broadcasting undialable multiaddrs but
89
+ // // here we are explicitly connecting to a local node so do not deny dialing
90
+ // // any discovered address
91
+ // return false
92
+ // }
93
+ // }
94
+ // break
96
95
case 'ws' :
97
96
options . transports = [ webSockets ( ) ]
98
97
options . addresses = {
@@ -114,17 +113,18 @@ describe('ping test', function () {
114
113
let skipMuxer = false
115
114
switch ( TRANSPORT ) {
116
115
case 'webtransport' :
117
- case 'webrtc-direct' :
118
- skipSecureChannel = true
119
- skipMuxer = true
120
- break
121
- case 'webrtc' :
122
- skipSecureChannel = true
123
- skipMuxer = true
124
- // Setup yamux and noise to connect to the relay node
125
- options . streamMuxers = [ yamux ( ) ]
126
- options . connectionEncryption = [ noise ( ) ]
127
- break
116
+ // #TODO: We can re-introduce this once https://github.com/libp2p/js-libp2p/issues/1846 is resolved
117
+ // case 'webrtc-direct':
118
+ // skipSecureChannel = true
119
+ // skipMuxer = true
120
+ // break
121
+ // case 'webrtc':
122
+ // skipSecureChannel = true
123
+ // skipMuxer = true
124
+ // // Setup yamux and noise to connect to the relay node
125
+ // options.streamMuxers = [yamux()]
126
+ // options.connectionEncryption = [noise()]
127
+ // break
128
128
default :
129
129
// Do nothing
130
130
}
0 commit comments