Skip to content

Commit 58a5528

Browse files
committed
chore(@libp2p/multidim-interop): remove webrtc support temp (libp2p#2005)
1 parent 9a69e6f commit 58a5528

File tree

2 files changed

+40
-41
lines changed

2 files changed

+40
-41
lines changed

interop/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"@chainsafe/libp2p-yamux": "^5.0.0",
4444
"@libp2p/mplex": "^9.0.0",
4545
"@libp2p/tcp": "^8.0.0",
46-
"@libp2p/webrtc": "^3.0.0",
4746
"@libp2p/websockets": "^7.0.0",
4847
"@libp2p/webtransport": "^3.0.0",
4948
"@multiformats/mafmt": "^12.1.2",

interop/test/ping.spec.ts

+40-40
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ import { noise } from '@chainsafe/libp2p-noise'
66
import { yamux } from '@chainsafe/libp2p-yamux'
77
import { mplex } from '@libp2p/mplex'
88
import { tcp } from '@libp2p/tcp'
9-
import { webRTC, webRTCDirect } from '@libp2p/webrtc'
109
import { webSockets } from '@libp2p/websockets'
11-
import * as filters from '@libp2p/websockets/filters'
1210
import { webTransport } from '@libp2p/webtransport'
1311
import { type Multiaddr, multiaddr } from '@multiformats/multiaddr'
1412
import { createLibp2p, type Libp2p, type Libp2pOptions } from 'libp2p'
15-
import { circuitRelayTransport } from 'libp2p/circuit-relay'
1613
import { type IdentifyService, identifyService } from 'libp2p/identify'
1714
import { pingService, type PingService } from 'libp2p/ping'
1815

@@ -67,32 +64,34 @@ describe('ping test', function () {
6764
throw new Error('WebTransport is not supported as a listener')
6865
}
6966
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
9695
case 'ws':
9796
options.transports = [webSockets()]
9897
options.addresses = {
@@ -114,17 +113,18 @@ describe('ping test', function () {
114113
let skipMuxer = false
115114
switch (TRANSPORT) {
116115
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
128128
default:
129129
// Do nothing
130130
}

0 commit comments

Comments
 (0)