Socket.io can't receive events

TD2020.27390 win x64
I’m not sure if it’s a bug or am I doing something wrong?
I’ve setup a basic socket.io app.
I’m able to communicate webpage → nodejs server, TD → nodejs server, but I can’t get any events from server in TD.
Here’s how i set up everything in TD. Can you please help me? I’ve tried this with socket.io v2.1.0 and v.2.4.0

You say you want to get information from the server in td but the screenshot you show is about sending data from TD to the server.
Can you please also share the code from the websocket-server or at least the snipet where you send a message from the server to TD?

Here’s the nodejs code

    const app = require('express')();
    const http = require('http').createServer(app);

    const io = require('socket.io')(http);

    app.get('/', (req, res) => {

        res.sendFile(__dirname + '/index.html');

    });

    io.on('connection', (socket) => {

      console.log('a user connected');

    });

    io.on('connection', (socket) => {

      socket.on('slider', (val) => {

        console.log(val);

      });

      socket.on('TD', (val) => {

          console.log(val)});

    });

    http.listen(7000, () => {

      console.log('listening on *:7000');

    });

And here’s the frontend

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Socket.io test</title>

</head>

<body>

    <div id="main">

        <div class="slidecontainer">

            <input type="range" min="1" max="100" value="50" class="slider" id="myRange">

            <p>Value: <span id="demo"></span></p>

          </div>

    </div>

<script src="/socket.io/socket.io.js"></script>

<script>

    var slider = document.getElementById("myRange");

    var output = document.getElementById("demo");

    var socket = io();

    output.innerHTML = slider.value; // Display the default slider value

    // Update the current slider value (each time you drag the slider handle)

    slider.oninput = function() {

     output.innerHTML = this.value;

     socket.emit('slider', this.value);

    }

  </script>

</body>

</html>

First off, not sure about invoking the the onConnection callback twice. Maybe move the user connection message into the second onConnection callback.

Ok, so what exactly do you expect to happen and what does then actually happen?
Right now you are only listening for events from your connected clients and printing the values out. Maybe you also want to broadcast a new message to all clients with the received value?

Thanks, I’ve figured it out. I’ve missed the io.emit on the server side. Because I’ve got the wrong idea on how it suppose to work. I thought that if multiple clients connect to the same server they can see all the messages without the need for server to explicitly emit something.

Thanks for your help!