mirror of
https://github.com/fosrl/pangolin.git
synced 2026-04-24 23:14:05 +00:00
add exit node name
This commit is contained in:
@@ -19,16 +19,19 @@ export const handleNewtPingRequestMessage: MessageHandler = async (context) => {
|
|||||||
.select()
|
.select()
|
||||||
.from(exitNodes);
|
.from(exitNodes);
|
||||||
|
|
||||||
let exitNodesPayload = exitNodesList.map((node) => ({
|
const exitNodesPayload = exitNodesList.map((node) => ({
|
||||||
exitNodeId: node.exitNodeId,
|
exitNodeId: node.exitNodeId,
|
||||||
|
exitNodeName: node.name,
|
||||||
endpoint: node.endpoint,
|
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 {
|
return {
|
||||||
message: {
|
message: {
|
||||||
type: "newt/ping/exitNodes",
|
type: "newt/ping/exitNodes",
|
||||||
data: {
|
data: {
|
||||||
exitNodes: exitNodesPayload
|
exitNodes: exitNodesPayload
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user