This commit is contained in:
parent
4a3c26b7fa
commit
58645ec2b2
@ -22,7 +22,7 @@ export default class NodeManager {
|
||||
* @returns the node
|
||||
*/
|
||||
getRandomNode() {
|
||||
const randomIndex = Math.floor(Math.random() * this.nodes.length);
|
||||
return this.nodes[randomIndex];
|
||||
const index = Math.floor(Math.random() * this.nodes.length);
|
||||
return this.nodes[index];
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,11 @@ export default class ProxyRoute extends Route {
|
||||
return;
|
||||
}
|
||||
|
||||
// Log the request
|
||||
console.log(
|
||||
`[${response.headers["X-Proxy-Node"]}] ${url} - ${response.status}`
|
||||
);
|
||||
|
||||
// Return the JSON response
|
||||
res.status(response.status).set(response.headers).json(data);
|
||||
} catch (ex: any) {
|
||||
|
Loading…
Reference in New Issue
Block a user