feat(utilities): WS x-forwarded-for
This commit is contained in:
parent
09926d175a
commit
1b764bb285
1 changed files with 2 additions and 2 deletions
|
|
@ -147,8 +147,8 @@ function extractSessionInfo(socket) {
|
|||
geoip2Reader.open(process.env.MAXMINDDB_FILE, options)
|
||||
.then(reader => {
|
||||
console.log("looking for location of ");
|
||||
console.log(socket.handshake.headers['x-real-ip'] || socket.handshake.address);
|
||||
let country = reader.country(socket.handshake.headers['x-real-ip'] || socket.handshake.address);
|
||||
console.log(socket.handshake.headers['x-forwarded-for'] || socket.handshake.address);
|
||||
let country = reader.country(socket.handshake.headers['x-forwarded-for'] || socket.handshake.address);
|
||||
socket.handshake.query.sessionInfo.userCountry = country.country.isoCode;
|
||||
})
|
||||
.catch(error => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue