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

webrtc-explorer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webrtc-explorer - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "webrtc-explorer",
"version": "1.0.4",
"version": "1.0.5",
"description": "Chord inspired ring DHT algorithm using WebRTC as transport layer for P2P in the browser",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -22,3 +22,3 @@ webrtc-explorer

## Create a new peer
### Create a new peer

@@ -38,32 +38,49 @@ ```

## Register the peer
### Register the peer
```
peer.events.on('registered', function(data){
// peer registered with data.peerId
});
peer.register();
```
## Send and receive a message
### Send and receive a message
peerIds are 48 bits represented in a string using hex format. To send, in one peer:
```
var data = 'hey peer, how is it going';
peer.send('abcd0f0fdbca', data);
```
## Other options
To receive, in another peer (responsible for that Id)
### logging
```
peer.events.on('message', function(envelope){
// message from the other peer envelope.data
});
```
### Other options
#### logging
add the logging flag to your config
```
var config = {
```
var config = {
//...
logging: true
//...
};
```
};
```
# How does it work
Read the CHORD paper
Some important learnings that are part of webrtc-explorer, were done in webrtc-ring
http://blog.daviddias.me/2014/12/20/webrtc-ring
To understand fully webrtc-explorer's core, it is crucial to be familiar with the [Chord][chord-paper]. webrtc-explorer levarages important battle experience from building webrtc-ring - http://blog.daviddias.me/2014/12/20/webrtc-ring
* I'll upload my notes and images `soon`, I'm trying to make them as legible as possible. If you have a urgency in one of the parts, please let me know, so that I put that one as a priority.
## Registering a peer

@@ -76,2 +93,8 @@

## Message routing
[chord-paper]: http://pdos.csail.mit.edu/papers/chord:sigcomm01/chord_sigcomm.pdf
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