Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

v0.15.0

Compare
Choose a tag to compare
@vasco-santos vasco-santos released this 24 Nov 09:15
· 142 commits to master since this release

Bug Fixes

Features

BREAKING CHANGES

  • Only DNS+WSS addresses are now returned on filter by default in the browser. This can be overritten by the filter option and filters are provided in the module.

While this is not an API breaking change, there was a behavioral breaking change on the Websockets transport when in a browser environment. This change might create issues on local test setups.
libp2p-websockets has allowed TCP and DNS addresses, both with ws or wss to be used for dial purposes. Taking into account security (and browser policies), we are now restricting addresses to DNS + wss in the browser
With this new behavior, if you need to use non DNS addresses for testing, you can configure your libp2p node as follows:

const Websockets = require('libp2p-websockets')
const filters = require('libp2p-websockets/src/filters')
const Libp2p = require('libp2p')

const transportKey = Websockets.prototype[Symbol.toStringTag]
const libp2p = await Libp2p.create({
  modules: {
    transport: [Websockets]
    // ... Add required modules according to the Configuration docs
  },
  config: {
    transport: {
      [transportKey]: {
        filter: filters.all
      }
    }
  }
})