Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between "listen on" and "connect to" in Node-RED sockets

I'm learning Node-RED and trying to use its WebSockets node. I can't find any documentation that explains the difference between "listen on" and "connect to" type of sockets. Can someone explain that to me or point me in the right direction?

like image 666
Rahul Avatar asked Oct 28 '25 07:10

Rahul


1 Answers

The WebSocket nodes can be configured to either act as a WebSocket Client or Server.

  • connect to a remote WebSocket server - in other words, act as a Client
  • listen on a path (eg /my-websocket-endpoint) hosted by the runtime server for connections coming into it - in other words, act as a Server

So the choice will depend on whether you need to connect to a remote server, or listen of connections coming into your server.

like image 185
knolleary Avatar answered Oct 31 '25 08:10

knolleary