Created
July 10, 2013 21:02
-
-
Save alanhoff/5970303 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
var server = net.createConnection(99, 'localhost'); //modificar a porta e o host | |
var filePath = __dirname + '/read.json'; //caminho do arquivo a ser lido, o arquivo precisa existir | |
var file = require('fs').createReadStream(filePath); | |
server.on('connect', function(socket) { | |
file.pipe(server); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment