Comparing version 0.10.5 to 0.10.6
@@ -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) { |
{ | ||
"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) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131051
2357
Updatedssb-conn-hub@~0.2.7
Updatedssb-conn-query@~0.4.4