Skip to content

Instantly share code, notes, and snippets.

View songlairui's full-sized avatar
🌴
On vacation

lary songlairui

🌴
On vacation
  • Bytedance
  • ShenZhen
View GitHub Profile
@songlairui
songlairui / nodejs-tcp-example.js
Created February 3, 2019 12:37 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');