mirror of
https://github.com/fluencelabs/js-libp2p-tcp
synced 2025-04-27 04:22:17 +00:00
chore: nicer addr name in README
This commit is contained in:
parent
fb206cfd66
commit
1a2fd636eb
@ -44,7 +44,7 @@ const multiaddr = require('multiaddr')
|
|||||||
const pipe = require('it-pipe')
|
const pipe = require('it-pipe')
|
||||||
const { collect } = require('streaming-iterables')
|
const { collect } = require('streaming-iterables')
|
||||||
|
|
||||||
const mh = multiaddr('/ip4/127.0.0.1/tcp/9090')
|
const addr = multiaddr('/ip4/127.0.0.1/tcp/9090')
|
||||||
|
|
||||||
const tcp = new TCP()
|
const tcp = new TCP()
|
||||||
|
|
||||||
@ -56,10 +56,10 @@ const listener = tcp.createListener((socket) => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
await listener.listen(mh)
|
await listener.listen(addr)
|
||||||
console.log('listening')
|
console.log('listening')
|
||||||
|
|
||||||
const socket = await tcp.dial(mh)
|
const socket = await tcp.dial(addr)
|
||||||
const values = await pipe(
|
const values = await pipe(
|
||||||
socket,
|
socket,
|
||||||
collect
|
collect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user