index.ts425 chars21 lines
This code creates a TCP client using the net
module in Node.js. It connects to a server at the specified HOST
and PORT
and sends a message. When it receives data from the server, it logs the data and closes the socket. The client also logs when it connects and disconnects from the server.
gistlibby LogSnag