mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 10:05:53 +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,
|
||||
endpoint: site.endpoint,
|
||||
publicKey: site.publicKey,
|
||||
serverIP: site.address
|
||||
serverIP: site.address,
|
||||
serverPort: site.listenPort,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -40,22 +40,12 @@ export const handleOlmRelayMessage: MessageHandler = async (context) => {
|
|||
return;
|
||||
}
|
||||
|
||||
const sitesData = await db
|
||||
.select()
|
||||
.from(sites)
|
||||
.innerJoin(clientSites, eq(sites.siteId, clientSites.siteId))
|
||||
.where(eq(clientSites.clientId, client.clientId));
|
||||
const { siteId } = message.data;
|
||||
|
||||
let jobs: Array<Promise<void>> = [];
|
||||
for (const site of sitesData) {
|
||||
// update the peer on the exit node
|
||||
const job = updatePeer(site.sites.siteId, client.pubKey, {
|
||||
endpoint: "" // this removes the endpoint
|
||||
});
|
||||
jobs.push(job);
|
||||
}
|
||||
|
||||
await Promise.all(jobs);
|
||||
// update the peer on the exit node
|
||||
await updatePeer(siteId, client.pubKey, {
|
||||
endpoint: "" // this removes the endpoint
|
||||
});
|
||||
|
||||
return;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue