Answer the question
In order to leave comments, you need to log in
How to get the IP address of a local network computer in node.js?
Good afternoon.
I'm trying to write an in-company chat (the most beginner node.js-ist)
var io = require('socket.io').listen(app.listen(port));
io.sockets.on('connection', function(client){
var adr = client.handshake.address;
console.log(adr);
var socketId = client.id;
var clientIp = client.manager.handshake[socketId].address;
console.log(client.request.headers);
console.log(client.handshake.headers['x-forwarded-for'] || client.handshake.address.address);
console.log(client.request.connection.remoteAddress);
var address = client.handshake.address;
console.log("New connection from " + address.address + ":" + address.port);
Answer the question
In order to leave comments, you need to log in
And then Vasya will be fired, and Petya will come to his computer, and he will still write “hello, Vasya” to him? Or some sly thread from the neighbor’s computer will write to the chat “I’m a goosefil!” at lunchtime.
Why not do the good old authorization with a login-password?
Vasya will be fired - I will replace Jason's file with SP and first name and last name with the one whom they
did not want to take precisely so as not to write every time - I am Annabelle, the password for such and such a
chat is not for conversations, but for work
"to make documents for LLC "Sweet Pretzel" "
mark masha and say, send,
and similar
login should not cause inconvenience. just went to the address and that's it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question