Skip to content

Instantly share code, notes, and snippets.

Created Jan 9, 2019
What would you like to do?
const server = require('net').createServer()
server.on('connection', socket => {
console.log('client connected')
socket.write('welcom client\n')
socket.on('data', data => {
console.log('data is:', data)
socket.write('data is: ')
socket.on('end', () => {
console.log('client disconnected')
server.listen(8000, ()=> console.log('server bound'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment