libp2p-websockets
JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport spec
Last updated 5 years ago by jacobheun .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install libp2p-websockets 
SYNC missed versions from official npm registry.

js-libp2p-websockets

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

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

Example

const WS = require('libp2p-websockets')
const multiaddr = require('multiaddr')
const pipe = require('it-pipe')
const { collect } = require('streaming-iterables')

const addr = multiaddr('/ip4/0.0.0.0/tcp/9090/ws')

const ws = new WS({ upgrader })

const listener = ws.createListener((socket) => {
  console.log('new connection opened')
  pipe(
    ['hello'],
    socket
  )
})

await listener.listen(addr)
console.log('listening')

const socket = await ws.dial(addr)
const values = await pipe(
  socket,
  collect
)
console.log(`Value: ${values.toString()}`)

// Close connection after reading
await listener.close()

API

Transport

Connection

Current Tags

  • 0.15.0                                ...           beta (4 years ago)
  • 0.16.2                                ...           latest (3 years ago)

56 Versions

  • 0.16.2                                ...           3 years ago
  • 0.16.1                                ...           3 years ago
  • 0.16.0                                ...           3 years ago
  • 0.15.9                                ...           4 years ago
  • 0.15.8                                ...           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
Maintainers (1)
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (10)
Dev Dependencies (9)

© 2010 - cnpmjs.org x YWFE | Home | YWFE