A libp2p transport based on WebSockets.
import { createLibp2p } from 'libp2p'import { webSockets } from '@libp2p/websockets'import { multiaddr } from '@multiformats/multiaddr'const node = await createLibp2p({ transports: [ webSockets() ]//... other config})await node.start()const ma = multiaddr('/dns4/example.com/tcp/9090/tls/ws')await node.dial(ma) Copy
import { createLibp2p } from 'libp2p'import { webSockets } from '@libp2p/websockets'import { multiaddr } from '@multiformats/multiaddr'const node = await createLibp2p({ transports: [ webSockets() ]//... other config})await node.start()const ma = multiaddr('/dns4/example.com/tcp/9090/tls/ws')await node.dial(ma)
A libp2p transport based on WebSockets.
Example