@ipshipyard/libp2p-auto-tls
    Preparing search index...

      @ipshipyard/libp2p-auto-tls

      When a publicly dialable address is detected, use the p2p-forge service at https://registration.libp2p.direct to acquire a valid Let's Encrypt-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.

      import { noise } from '@chainsafe/libp2p-noise'
      import { yamux } from '@chainsafe/libp2p-yamux'
      import { autoTLS } from '@ipshipyard/libp2p-auto-tls'
      import { autoNAT } from '@libp2p/autonat'
      import { identify } from '@libp2p/identify'
      import { keychain } from '@libp2p/keychain'
      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: {
      autoNAT: autoNAT(),
      autoTLS: autoTLS(),
      identify: identify(),
      keychain: keychain(),
      upnp: uPnPNAT()
      }
      })

      // ...time passes

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

      Interfaces

      AutoTLS
      AutoTLSComponents
      AutoTLSInit

      Functions

      autoTLS