request.js/tests/tcp-listener.js

12 lines
275 B
JavaScript
Raw Normal View History

2018-07-07 01:38:47 +00:00
'use strict';
var net = require('net');
2019-10-29 20:31:30 +00:00
var server = net.createServer(function(socket) {
socket.on('data', function(chunk) {
console.info(chunk.toString('utf8'));
});
});
server.listen(3007, function() {
console.info('Listening on', this.address());
2018-07-07 01:38:47 +00:00
});