mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-06 18:56:39 +00:00
Handle multiple hp messages
This commit is contained in:
@@ -52,16 +52,25 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
|||||||
|
|
||||||
const exitNodesHpData = allExitNodes.map((exitNode: ExitNode) => {
|
const exitNodesHpData = allExitNodes.map((exitNode: ExitNode) => {
|
||||||
return {
|
return {
|
||||||
serverPubKey: exitNode.publicKey,
|
publicKey: exitNode.publicKey,
|
||||||
endpoint: exitNode.endpoint
|
endpoint: exitNode.endpoint
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// Send holepunch message
|
// Send holepunch message
|
||||||
await sendToClient(olm.olmId, {
|
await sendToClient(olm.olmId, {
|
||||||
type: "olm/wg/holepunch",
|
type: "olm/wg/holepunch/all",
|
||||||
data: {
|
data: {
|
||||||
exitNodes: exitNodesHpData,
|
exitNodes: exitNodesHpData
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// THIS IS FOR BACKWARDS COMPATIBILITY
|
||||||
|
await sendToClient(olm.olmId, {
|
||||||
|
type: "olm/wg/holepunch/all",
|
||||||
|
data: {
|
||||||
|
serverPubKey: allExitNodes[0].publicKey,
|
||||||
|
endpoint: allExitNodes[0].endpoint
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user