mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-03 09:34:48 +02:00
add exit node name
This commit is contained in:
parent
72d8ad3204
commit
08556789f9
1 changed files with 6 additions and 3 deletions
|
@ -19,16 +19,19 @@ export const handleNewtPingRequestMessage: MessageHandler = async (context) => {
|
|||
.select()
|
||||
.from(exitNodes);
|
||||
|
||||
let exitNodesPayload = exitNodesList.map((node) => ({
|
||||
const exitNodesPayload = exitNodesList.map((node) => ({
|
||||
exitNodeId: node.exitNodeId,
|
||||
exitNodeName: node.name,
|
||||
endpoint: node.endpoint,
|
||||
weight: 0 // TODO: Implement weight calculation if needed depending on load
|
||||
weight: 1 // TODO: Implement weight calculation if needed depending on load
|
||||
// (MAX_CONNECTIONS - current_connections) / MAX_CONNECTIONS)
|
||||
// higher = more desirable
|
||||
}));
|
||||
|
||||
return {
|
||||
message: {
|
||||
type: "newt/ping/exitNodes",
|
||||
data: {
|
||||
data: {
|
||||
exitNodes: exitNodesPayload
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue