We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how can a server get the ip address from the client?
The text was updated successfully, but these errors were encountered:
The remote address should be available via the conn.socket.remoteAddress property. For example:
conn.socket.remoteAddress
const ws = require('nodejs-websocket'); const LISTEN_ADDRESS = '0.0.0.0'; const LISTEN_PORT = 8080; let server = ws.createServer(function(conn) { let rAddr = conn.socket.remoteAddress; let rPort = conn.socket.remotePort; console.log(`New connection from ${rAddr}:${rPort}`); }).listen(LISTEN_PORT, LISTEN_ADDRESS);
Sorry, something went wrong.
No branches or pull requests
how can a server get the ip address from the client?
The text was updated successfully, but these errors were encountered: