We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93117bd commit f9467b2Copy full SHA for f9467b2
JavaScript/2-WS/server.js
@@ -62,8 +62,8 @@ const server = http.createServer(async (req, res) => {
62
63
const ws = new WebSocket.Server({ server });
64
65
-ws.on('connection', (connection) => {
66
- console.log('Connected ' + connection.remoteAddress);
+ws.on('connection', (connection, req) => {
+ console.log('Connected ' + req.socket.remoteAddress);
67
connection.on('message', async (message) => {
68
console.log('Received: ' + message);
69
const obj = JSON.parse(message);
0 commit comments