db records TOS acceptance

This commit is contained in:
tim
2025-01-30 12:25:14 -04:00
parent 2f5a626e5c
commit 5af7422b9d
4 changed files with 28 additions and 11 deletions

View File

@@ -2,3 +2,8 @@ import util from "util";
import fs from "fs";
export const readFile = (fileName) => util.promisify(fs.readFile)(fileName, 'utf8');
export function clientIP(socket) {
// X-Forwarded-For
return socket.handshake.headers['x-forwarded-for']?.split(',')[0] || socket.handshake.address;
}