Socket
Socket
Sign inDemoInstall

webrtc-signal-http

Package Overview
Dependencies
96
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.4.0

10

lib/index.js

@@ -54,3 +54,2 @@ const express = require('express')

const peerId = router.peerList.addPeer(req.query.peer_name, res)
const peerListStr = router.peerList.format()

@@ -61,3 +60,3 @@ // send back the list of peers

.set('Content-Type', 'text/plain')
.send(peerListStr)
.send(router.peerList.dataFor(peerId))

@@ -68,3 +67,3 @@ // send an updated peer list to all peers

// "ourselves", namely the srcId == destId
sendPeerMessage(id, id, peerListStr)
sendPeerMessage(id, id, router.peerList.dataFor(id))
})

@@ -129,5 +128,2 @@ })

// format the updated peerList
const peerListStr = router.peerList.format()
// send an updated peer list to all peers

@@ -137,3 +133,3 @@ router.peerList.getPeerIds().forEach((id) => {

// "ourselves", namely the srcId == destId
sendPeerMessage(id, id, peerListStr)
sendPeerMessage(id, id, router.peerList.dataFor(id))
})

@@ -140,0 +136,0 @@

@@ -24,2 +24,3 @@ const Peer = require('./peer')

}
}

@@ -67,2 +68,8 @@

}
dataFor(id) {
//returns the data that should appear for a given ID
//This is the primary part of peer-list that is extensible
return this.format()
}
}
{
"name": "webrtc-signal-http",
"version": "1.3.0",
"version": "1.4.0",
"description": "opinionated webrtc signal provider using http as a protocol",

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

@@ -277,2 +277,16 @@ const assert = require('assert')

})
it('should support formatting via dataFor() method', () => {
const instance = new PeerList()
instance.addPeer('test', { obj: true })
assert.equal(instance.dataFor('test'), 'test,1,0\n')
instance.addPeer('test2', { obj: true })
assert.equal(instance.dataFor('test2'), 'test2,2,0\ntest,1,0\n')
})
})

@@ -279,0 +293,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc