monkey patch base64 IDs to base58 for now

This commit is contained in:
Andre Staltz 2023-07-13 11:14:50 +03:00
parent 9fe47c2b9f
commit d60b639b1c
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,7 @@
// @ts-ignore
const DuplexPair = require('pull-pair/duplex') // @ts-ignore
const Notify = require('pull-notify')
const bs58 = require('bs58')
const debug = require('debug')('ppppp:hub-client')
const makeTunnelPlugin = require('./ms-tunnel')
const { ErrorDuplex } = require('./utils')
@ -51,7 +52,8 @@ module.exports = {
*/
connect(origin) {
// @ts-ignore
const hub = this.id // FIXME: this comes from secret-stack
// FIXME: this comes from secret-stack
const hub = bs58.encode(Buffer.from(this.id, 'base64'))
debug('received hubClient.connect(%s) via hub %s', origin, hub)
if (hubs.has(hub) && origin) {
debug('connect() will resolve because handler exists')