mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-29 06:08:15 +02:00
Relaying working
This commit is contained in:
parent
e57574ba9c
commit
8398f7b7c0
2 changed files with 7 additions and 16 deletions
|
@ -142,7 +142,8 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
||||||
siteId: site.siteId,
|
siteId: site.siteId,
|
||||||
endpoint: site.endpoint,
|
endpoint: site.endpoint,
|
||||||
publicKey: site.publicKey,
|
publicKey: site.publicKey,
|
||||||
serverIP: site.address
|
serverIP: site.address,
|
||||||
|
serverPort: site.listenPort,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,22 +40,12 @@ export const handleOlmRelayMessage: MessageHandler = async (context) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sitesData = await db
|
const { siteId } = message.data;
|
||||||
.select()
|
|
||||||
.from(sites)
|
|
||||||
.innerJoin(clientSites, eq(sites.siteId, clientSites.siteId))
|
|
||||||
.where(eq(clientSites.clientId, client.clientId));
|
|
||||||
|
|
||||||
let jobs: Array<Promise<void>> = [];
|
// update the peer on the exit node
|
||||||
for (const site of sitesData) {
|
await updatePeer(siteId, client.pubKey, {
|
||||||
// update the peer on the exit node
|
endpoint: "" // this removes the endpoint
|
||||||
const job = updatePeer(site.sites.siteId, client.pubKey, {
|
});
|
||||||
endpoint: "" // this removes the endpoint
|
|
||||||
});
|
|
||||||
jobs.push(job);
|
|
||||||
}
|
|
||||||
|
|
||||||
await Promise.all(jobs);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue