Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ipfs-pubsub-1on1

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipfs-pubsub-1on1

1-to-1 communication channel over IPFS Pubsub between two peers

  • 0.0.8-5e2b754.0
  • npm
  • Socket score

Version published
Weekly downloads
329
decreased by-19.16%
Maintainers
3
Weekly downloads
 
Created
Source

ipfs-pubsub-1on1

Communication channel between two peers over IPFS Pubsub

Work in progress!

ipfs-pubsub-1on1 is a 1-to-1 communication channel over IPFS Pubsub. It enables two peers to exchange messages between each other. Note that the channel is currently not authenticated nor encrypted!

Usage

// Include as lib
import Channel from 'ipfs-pubsub-1on1'
// Create IPFS instance somehow
const ipfs = new IPFS()
// IPFS peer ID of the peer to connect to
const friendId = 'QmP9TWCAsHLs6a3hcCbqE6WZs3VhQF6QsmkFPAFmmcuMa6'
// Open a channel with the other peer
const channel = await Channel.open(ipfs, friendId)
// Explicitly wait for peers to connect
await channel.connect()
// Send message on the channel
await channel.send('Hello World!')
// Process messages from the other peer
channel.on('message', (message) => {
  console.log('Message from', message.from, message)
})

For more usage examples, see the tests

FAQs

Package last updated on 19 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc