mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-04 09:46:40 +00:00
Relaying working
This commit is contained in:
@@ -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;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user