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

peer-exchange

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

peer-exchange - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

.nyc_output/57073.json

3

lib/exchange.js

@@ -90,2 +90,3 @@ 'use strict';

peer.incoming = !outgoing;
peer.transport = socket.transport;
peer.once('error', function (err) {

@@ -122,3 +123,3 @@ _this3.removePeer(peer);

if (_this4._accepts[transportId]) {
unaccept();
if (unaccept) unaccept();
return cb(alreadyAcceptingError);

@@ -125,0 +126,0 @@ }

'use strict';
var http = require('http');
var https = require('https');
var getBrowserRTC = require('get-browser-rtc');

@@ -53,7 +54,12 @@ var SimplePeer = require('simple-peer');

accept: function accept(opts, onConnection, cb) {
// TODO: option for already-created http(s) server
if (!opts.port) {
throw new Error('Must specify "port" option');
}
var server = http.createServer();
var httpsOpts;
if (opts.https) {
httpsOpts = opts.https;
delete opts.https;
opts.secure = true;
}
var server = httpsOpts ? https.createServer(https) : http.createServer();
server.on('error', cb);

@@ -60,0 +66,0 @@ server.listen(opts.port, function () {

@@ -24,4 +24,4 @@ 'use strict';

if (socket._socket) {
var address = getRemoteAddress(socket._socket);
if (address) return address;
var _address = getRemoteAddress(socket._socket);
if (_address) return _address;
}

@@ -28,0 +28,0 @@ }

{
"name": "peer-exchange",
"version": "0.4.1",
"version": "0.5.0",
"description": "Decentralized peer discovery and signaling",

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

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