Skip to content

Instantly share code, notes, and snippets.

@eerne
Created July 5, 2011 06:29
Show Gist options
  • Save eerne/1064348 to your computer and use it in GitHub Desktop.
Save eerne/1064348 to your computer and use it in GitHub Desktop.
// https://github.com/mozilla/chromeless/blob/master/modules/lib/net.js
var net = require('net'),
server = net.Server();
server.listen(8111, 'localhost', function(){
console.log('listen');
});
server.on('connection', function(stream){
stream.on('data', function(data){
console.log('data', data); // receiving data from pd
});
});
var socket2pd = net.createConnection(8112, 'localhost');
socket2pd.write('ads f;\n'); // sending data to pd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment