Use nodejs to write a listener to get the data sent by the terminal to the server

I have an Internet of things terminal device that sends data to the designated port of the cloud server (including device number, base station information, light intensity temperature, etc.). Now I want to use nodejs to write a listener on the server side to listen for the data sent by the local port terminal. How can I listen to the data and serialize it?

Apr.11,2022

if you want to monitor the data sent by the terminal device, I think you should pay attention to two points:
1. How does the interrupt device send data to the port, whether it connects to the specified ip and port through socket, or connects to the designated port through http protocol. The scenarios for node's http and net modules are different.
2. The terminal can send the JSON string, and then parse it on the node side.
instance of http simple server

 

listening data

you can use package capture software, such as wireshark, tcpdump, etc., or call components such as libpcap.

serialize data

you need to know the communication protocol between the terminal and the server and how the data is exchanged.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b388a5-2c102.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b388a5-2c102.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?