@sz-md/node-tcp-client
v0.1.2
Published
A simple TCP client module:
Downloads
7
Readme
@sz-md/node-tcp-client
A simple TCP client module:
const NodeTCPClient = require("@sz-md/node-tcp-client")
const decoder = new TextDecoder("utf8")
const client = await NodeTCPClient.create({
host: "google.com",
port: 80
})
client.on("data", (data) => {
console.log("Received", decoder.decode(data), data)
client.close()
})
await client.write("HEAD / HTTP/1.1\r\n\r\n")