Skip to content

Instantly share code, notes, and snippets.

@leevigraham
Created April 6, 2014 05:22
Show Gist options
  • Save leevigraham/10001829 to your computer and use it in GitHub Desktop.
Save leevigraham/10001829 to your computer and use it in GitHub Desktop.
Simple Node script to launch a Telnet connection and control my Pioneer Receiver.
var net = require('net');
connection = net.connect(23, '192.168.2.5')
connection.setEncoding('utf8');
connection.on('connect', function(){
console.log('connected');
connection.on('data', function(data){
console.log(data);
});
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function (chunk) {
connection.write(chunk + "\r");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment