Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var net = require('net');
- var client = new net.Socket();
- client.connect(3333, 'localhost', function() {
- console.log('Connected');
- client.write('Hello, server! Love, Client.');
- });
- client.on('data', function(data) {
- console.log('Received: ' + data.toString());
- //client.destroy();
- });
- client.on('close', function() {
- console.log('Connection closed');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement