@libp2p/tcp
TypeScript icon, indicating that this package has built-in type declarations

9.0.26 • Public • Published

@libp2p/tcp

libp2p.io Discuss codecov CI

A TCP transport for libp2p

About

A libp2p transport based on the TCP networking stack.

Example

import { createLibp2p } from 'libp2p'
import { tcp } from '@libp2p/tcp'
import { multiaddr } from '@multiformats/multiaddr'

const node = await createLibp2p({
  transports: [
    tcp()
  ]
})

const ma = multiaddr('/ip4/123.123.123.123/tcp/1234')

// dial a TCP connection, timing out after 10 seconds
const connection = await node.dial(ma, {
  signal: AbortSignal.timeout(10_000)
})

// use connection...

Install

$ npm i @libp2p/tcp

API Docs

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

/@libp2p/tcp/

    Package Sidebar

    Install

    npm i @libp2p/tcp

    Weekly Downloads

    9,605

    Version

    9.0.26

    License

    Apache-2.0 OR MIT

    Unpacked Size

    152 kB

    Total Files

    30

    Last publish

    Collaborators

    • jacobheun
    • npm-service-account-libp2p
    • alanshaw
    • vascosantos
    • achingbrain
    • daviddias