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

ssb-conn

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssb-conn - npm Package Compare versions

Comparing version 0.10.5 to 0.10.6

21

lib/gossip.js

@@ -26,5 +26,2 @@ "use strict";

return address.address;
if (address.source === 'dht') {
return (['dht', address.host].join(':') + '~' + 'noauth');
}
let protocol = 'net';

@@ -39,21 +36,3 @@ if (address.host && address.host.endsWith('.onion'))

}
function isDhtAddress(addr) {
return typeof addr === 'string' && addr.substr(0, 4) === 'dht:';
}
function parseDhtAddress(addr) {
const [transport] = addr.split('~');
const [dhtTag, seed, remoteId] = transport.split(':');
if (dhtTag !== 'dht')
throw new Error('Invalid DHT address ' + addr);
return {
host: seed + ':' + remoteId,
port: 0,
key: remoteId[0] === '@' ? remoteId : '@' + remoteId,
source: 'dht',
};
}
function parseAddress(address) {
if (isDhtAddress(address)) {
return parseDhtAddress(address);
}
const legacyParsing = ref.parseAddress(address);

@@ -60,0 +39,0 @@ if (legacyParsing) {

6

package.json
{
"name": "ssb-conn",
"description": "SSB plugin for establishing and managing peer connections",
"version": "0.10.5",
"version": "0.10.6",
"homepage": "https://github.com/staltz/ssb-conn",

@@ -24,4 +24,4 @@ "main": "lib/index.js",

"ssb-conn-db": "~0.2.1",
"ssb-conn-hub": "~0.2.6",
"ssb-conn-query": "~0.4.3",
"ssb-conn-hub": "~0.2.7",
"ssb-conn-query": "~0.4.4",
"ssb-conn-staging": "~0.1.0",

@@ -28,0 +28,0 @@ "ssb-ref": "^2.13.9",

@@ -21,8 +21,2 @@ import {ListenEvent as HubEvent} from 'ssb-conn-hub/lib/types';

if (ref.isAddress(address.address)) return address.address!;
if (address.source === 'dht') {
return (
['dht', address.host].join(':') + '~' + 'noauth'
// ['shs', toBase64(address.key)].join(':')
);
}
let protocol = 'net';

@@ -39,22 +33,3 @@ if (address.host && address.host.endsWith('.onion')) protocol = 'onion';

function isDhtAddress(addr: any) {
return typeof addr === 'string' && addr.substr(0, 4) === 'dht:';
}
function parseDhtAddress(addr: string): Peer {
const [transport /*, transform */] = addr.split('~');
const [dhtTag, seed, remoteId] = transport.split(':');
if (dhtTag !== 'dht') throw new Error('Invalid DHT address ' + addr);
return {
host: seed + ':' + remoteId,
port: 0,
key: remoteId[0] === '@' ? remoteId : '@' + remoteId,
source: 'dht',
};
}
function parseAddress(address: string) {
if (isDhtAddress(address)) {
return parseDhtAddress(address);
}
const legacyParsing = ref.parseAddress(address);

@@ -61,0 +36,0 @@ if (legacyParsing) {

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