Basic Client
Problem
You want to access a service provided over the network.
Solution
Create a basic TCP client.
In Node.js
Example Usage
Accessing the Basic Server:
Discussion
The most important work takes place in the connection.on ‘data’ handler, where the client receives its response from the server and would most likely arrange for responses to it.
See also the Basic Server, Bi-Directional Client, and Bi-Directional Server recipes.
Exercises
- Add support for choosing the target domain and port based on command-line arguments or from a configuration file.