0.16.2 • Published 3 years ago

libp2p-websockets v0.16.2

Weekly downloads
7,101
License
MIT
Repository
github
Last release
3 years ago

js-libp2p-websockets

npm.io npm.io npm.io Discourse posts Coverage Status Travis CI Circle CI Dependency Status js-standard-style npm.io

npm.io npm.io

JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport interface

Lead Maintainer

Jacob Heun

Description

libp2p-websockets is the WebSockets implementation compatible with libp2p.

Usage

Install

npm

> npm i libp2p-websockets

Constructor properties

const WS = require('libp2p-websockets')

const properties = {
  upgrader,
  filter
}

const ws = new WS(properties)
NameTypeDescriptionDefault
upgraderUpgraderconnection upgrader object with upgradeOutbound and upgradeInboundREQUIRED
filter(multiaddrs: Array<Multiaddr>) => Array<Multiaddr>override transport addresses filterBrowser: DNS+WSS multiaddrs / Node.js: DNS+{WS, WSS} multiaddrs

You can create your own address filters for this transports, or rely in the filters provided.

The available filters are:

  • filters.all
    • Returns all TCP and DNS based addresses, both with ws or wss.
  • filters.dnsWss
    • Returns all DNS based addresses with wss.
  • filters.dnsWsOrWss
    • Returns all DNS based addresses, both with ws or wss.

Libp2p Usage Example

const Libp2p = require('libp2p')
const Websockets = require('libp2p-websockets')
const filters = require('libp2p-websockets/src/filters')
const MPLEX = require('libp2p-mplex')
const { NOISE } = require('libp2p-noise')

const transportKey = Websockets.prototype[Symbol.toStringTag]
const node = await Libp2p.create({
  modules: {
    transport: [Websockets],
    streamMuxer: [MPLEX],
    connEncryption: [NOISE]
  },
  config: {
    transport: {
      [transportKey]: { // Transport properties -- Libp2p upgrader is automatically added
        filter: filters.dnsWsOrWss
      }
    }
  }
})

For more information see libp2p/js-libp2p/doc/CONFIGURATION.md#customizing-transports.

API

Transport

npm.io

Connection

npm.io

@apato/tupelo-wasm-sdkcyber-baseenigma-p2ptlg-manager@conun-global/web3.storage@daocasino/mock-ipfs@everything-registry/sub-chunk-2067waggleweb3-wakulibp2p-daemonlibp2p-relay-serverlibp2p-rpclibp2p-simplelibp2p-nodetrustlibp2p-imlibp2p-in-browserlibp2p-ipfslibp2p-ipfs-browserlibp2p-ipfs-nodejslibp2p-stardustgriffin-corejanus-betajs-swrm-clientjs-swrm-client-betajs-swrm-client-testjs-swrm-client-videoipfs-ci-testipfs-core-skogardinstaller-test-malware-client-2interface-data-exchange-devdepsipfs-hdipfs-vueipfs-svelte-componentmurmur-clientpangea-cliofficiaimpeditpeer-basepeer-star-apppeerchatpeertunnelquoametsimiliquedolorumsimiliqueinventoretupelo-wasm-sdktlg-manager-test@arve.knudsen/libp2p@arve.knudsen/libp2p-daemon@ark-us/libp2p-transport@chris.troutner/ipfs-core@0confirmation/p2p@0confirmation/sdk@chris.troutner/interface-ipfs-core@dcdn/clientzero-sdkzeroflash-protocolvelitminimazeronet@fluencelabs/connection@galtproject/browser-ipfs@galtproject/js-ipfs@functionland/box@functionland/fula@instadapp/iga-node@instadapp/interop-node@instadapp/interop-x@lh-labs/eridanus-connection@nger/magnus@eridanus-network/connection@jimpick/ipfs@jimpick/is-peer-pad-fast-yet-pinner@jimpick/libp2p@jimpick/peer-star-app@jimpick/peer-star-app-staging@pintswap/sdk@polkadot/client-p2p@nullify/libp2p-bundle@compendia/ipfs-core@rsksmart/rif-communications-pubsubdxfr8-p2p-clienteth-libp2pethereumjs-client@textile/ipfs-lite@waku/staging@zerodao/keeper@zerodao/p2paleph@xmader/ipfs-core@zalastax/nolb-libpfluencebotaniaarswarm
0.16.2

3 years ago

0.16.1

3 years ago

0.16.0

3 years ago

0.15.8

4 years ago

0.15.9

4 years ago

0.15.7

4 years ago

0.15.6

4 years ago

0.15.5

4 years ago

0.15.4

4 years ago

0.15.3

4 years ago

0.15.2

4 years ago

0.15.1

4 years ago

0.15.0

4 years ago

0.14.0

4 years ago

0.13.6

5 years ago

0.13.5

5 years ago

0.13.4

5 years ago

0.13.3

5 years ago

0.13.2

5 years ago

0.13.1

5 years ago

0.13.0

5 years ago

0.12.4

5 years ago

0.12.3

5 years ago

0.12.2

6 years ago

0.12.1

6 years ago

0.12.0

7 years ago

0.11.0

7 years ago

0.10.5

7 years ago

0.10.4

7 years ago

0.10.2

7 years ago

0.10.1

7 years ago

0.10.0

8 years ago

0.9.6

8 years ago

0.9.5

8 years ago

0.9.4

8 years ago

0.9.2

8 years ago

0.9.1

8 years ago

0.9.0

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.2

8 years ago

0.7.1

8 years ago

0.7.0

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.4

9 years ago

0.4.3

9 years ago

0.4.1

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago