https://github.com/ramy-badr-ahmed/nodejs-tcp-server-client
TCP Communication with Node.js - https://doi.org/10.5281/zenodo.12808924
https://github.com/ramy-badr-ahmed/nodejs-tcp-server-client
nodejs osi-model tcp-client-server tcp-protocol transport-layer
Last synced: 5 days ago
JSON representation
TCP Communication with Node.js - https://doi.org/10.5281/zenodo.12808924
- Host: GitHub
- URL: https://github.com/ramy-badr-ahmed/nodejs-tcp-server-client
- Owner: Ramy-Badr-Ahmed
- License: apache-2.0
- Created: 2024-07-11T18:36:33.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-08-12T09:45:33.000Z (11 months ago)
- Last Synced: 2025-03-11T11:53:02.208Z (3 months ago)
- Topics: nodejs, osi-model, tcp-client-server, tcp-protocol, transport-layer
- Language: JavaScript
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
  
[](https://doi.org/10.5281/zenodo.12808924) [](https://archive.softwareheritage.org/swh:1:dir:3022219080921ea266808592fa83f3afc5242282;origin=https://github.com/Ramy-Badr-Ahmed/node-tcp;visit=swh:1:snp:e0d42b65bc06365c756247a55b21ca431f17a53a;anchor=swh:1:rev:d9e2239926489996936d18aa5804ce1fc2503181)
# TCP Communication with Node.js
A TCP server and client implementation using Node.js's `net` module, operating at the Transport Layer of the OSI Model.
This implementation focuses on direct communication without additional overhead such as data compression or encryption/decryption, suitable for safe and trusted networks.
The TLS variant (@Presentation-Layer of the OSI Model) is located here: [Node-TLS](https://github.com/Ramy-Badr-Ahmed/node-tls)
#### Some Use Cases:
- Network Diagnostics
> Test network connectivity and latency between network segments.- Embedded Systems Communication
> Integrate TCP client with embedded devices (e.g. Raspberry Pi, Arduino with Ethernet/Wi-Fi shields) to send data to a central server (for monitoring and control).- Time Synchronization
> Use the server to provide a timestamp service for devices on a network (ensure synchronized time across various systems).- IoT Apps
> Use the TCP server as a central hub to collect data from various IoT devices.
> Set up the TCP client to send sensor data periodically from remote IoT devices to the server for analysis (centralized data receiver/logger).
#### Quick Start:
Server:
```shell
npm install
node tcpServer.js # Runs Server
```
Client:
```shell
npm install
node tcpClient.js # Runs Client
```Logs and Outputs:
The server and client will log various server/client events and actions, such as connection establishment, data transmission, and encountered errors.
References
- [Net Module](https://nodejs.org/api/net.html)