mirror of https://codeberg.org/pzp/pzp-hub.git
use net.listen() pubkey field
This commit is contained in:
parent
a63a54987d
commit
e3fe7e88e4
|
@ -17,21 +17,6 @@ function ErrorDuplex(message) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} addresses
|
||||
* @returns {string | undefined}
|
||||
*/
|
||||
function extractSHSEPubkey(addresses) {
|
||||
for (const address of addresses.split(';')) {
|
||||
for (const [transport, transform] of address.split('~')) {
|
||||
const [name, pubkey, extra] = transform.split(':')
|
||||
if (name === 'shse') {
|
||||
return pubkey
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
name: 'hub',
|
||||
version: '1.0.0',
|
||||
|
@ -84,7 +69,7 @@ module.exports = {
|
|||
pull.filter(
|
||||
({ type }) => type === 'connecting-failed' || type === 'disconnected'
|
||||
),
|
||||
pull.map(({ address }) => extractSHSEPubkey(address)),
|
||||
pull.map(({ pubkey }) => pubkey),
|
||||
pull.filter((pubkey) => !!pubkey && attendants.has(pubkey)),
|
||||
pull.drain((pubkey) => {
|
||||
debug('farewell %s', pubkey)
|
||||
|
|
Loading…
Reference in New Issue