1.0.6 • Published 11 months ago

@libp2p/auto-tls v1.0.6

Weekly downloads
-
License
Apache-2.0 OR MIT
Repository
github
Last release
11 months ago

@libp2p/auto-tls

libp2p.io Discuss codecov CI

Automatically acquire a .libp2p.direct TLS certificate

About

When a publicly dialable address is detected, use the p2p-forge service at https://registration.libp2p.direct to acquire a valid Let's Encrypted-backed TLS certificate, which the node can then use with the relevant transports.

The node must be configured with a listener for at least one of the following transports:

  • TCP or WS or WSS, (along with the Yamux multiplexer and TLS or Noise encryption)
  • QUIC-v1
  • WebTransport

It also requires the Identify protocol.

Example - Use UPnP to hole punch and auto-upgrade to Secure WebSockets

import { noise } from '@chainsafe/libp2p-noise'
import { yamux } from '@chainsafe/libp2p-yamux'
import { autoTLS } from '@libp2p/auto-tls'
import { webSockets } from '@libp2p/websockets'
import { uPnPNAT } from '@libp2p/upnp-nat'
import { createLibp2p } from 'libp2p'

const node = await createLibp2p({
  addresses: {
    listen: [
      '/ip4/0.0.0.0/tcp/0/ws'
    ]
  },
  transports: [
    webSockets()
  ],
  connectionEncrypters: [
    noise()
  ],
  streamMuxers: [
    yamux()
  ],
  services: {
    autoTLS: autoTLS(),
    upnp: uPnPNAT()
  }
})

// ...time passes

console.info(node.getMultiaddrs())
// includes public WSS address:
// [ '/ip4/123.123.123.123/tcp/12345/wss ]

Install

$ npm i @libp2p/plaintext

Browser <script> tag

Loading this module through a script tag will make it's exports available as Libp2pPlaintext in the global namespace.

<script src="https://unpkg.com/@libp2p/plaintext/dist/index.min.js"></script>

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.

1.0.2

1 year ago

0.0.0-2625cc323

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.2-abe9bd154

12 months ago

0.0.0-2c182d2e2

1 year ago

1.0.4-f767126e1

11 months ago

1.0.6

11 months ago

0.0.0-99f5f270b

1 year ago

0.0.0-3650283f7

1 year ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

0.0.0-406b3916c

1 year ago

0.0.0-8a9258a24

1 year ago

0.0.0-a82b07d8c

1 year ago

0.0.0-b02ea9b6e

1 year ago

1.0.4-4bbcfa707

11 months ago

1.0.2-20d9ba73e

12 months ago

1.0.0-127abe24b

1 year ago

0.0.0-98b43045c

1 year ago

0.0.0-d19974d93

1 year ago

0.0.0-4a85eb033

1 year ago

0.0.0-0862522fe

1 year ago

1.0.4-723bde6ce

11 months ago

1.0.6-d72b51184

11 months ago

1.0.1-3c63482e5

1 year ago

1.0.0-5c4a79e5a

1 year ago

1.0.2-5acfae333

1 year ago

0.0.0-9614de7c6

1 year ago

1.0.5-d61cbacec

11 months ago

1.0.4-06fc82da8

11 months ago

0.0.0-6ab85ea68

1 year ago

1.0.6-34b3c14b8

11 months ago

1.0.5-bf0f74d66

11 months ago

0.0.0-bc90b4fd5

1 year ago

0.0.0-d6cd25d0d

1 year ago

1.0.3-fe8af37a1

11 months ago

0.0.0-06f79b646

1 year ago

0.0.0-6ddc1b80e

1 year ago

0.0.0-d866eb5bb

1 year ago

1.0.6-7a1665cd8

11 months ago

1.0.2-52f0f2f13

1 year ago

1.0.4-e2ec7bdaa

11 months ago

1.0.2-ae75570c8

12 months ago

1.0.2-f4747450f

1 year ago

1.0.3-c90984ec7

11 months ago

0.0.0-92cc74082

1 year ago

0.0.0-f8da60e73

1 year ago

1.0.6-96f14e429

11 months ago

1.0.4-15a70af5f

11 months ago

1.0.3-b56d91884

11 months ago

1.0.6-21088c519

11 months ago

1.0.5-26313e695

11 months ago

1.0.2-285dab7d7

1 year ago

0.0.0-339b7df88

1 year ago

0.0.0-96654117c

1 year ago

1.0.1-023ea575c

1 year ago

1.0.5-c1d0b7fa4

11 months ago

1.0.5-66c3ec5e1

11 months ago

1.0.1-d3e5a3382

1 year ago

0.0.0-4761dd701

1 year ago

0.0.0-f2f9008b8

1 year ago

1.0.5-80ddad5bb

11 months ago

0.0.0-a0c8ceb99

1 year ago

0.0.0-48e9cfa56

1 year ago

0.0.0-b248eefc0

1 year ago

0.0.0

1 year ago