Skip to content

Instantly share code, notes, and snippets.

@afuggini
Created April 21, 2014 17:34
Show Gist options
  • Save afuggini/11149863 to your computer and use it in GitHub Desktop.
Save afuggini/11149863 to your computer and use it in GitHub Desktop.
var torrentStream = require('torrent-stream');
var fs = require('fs');
var http = require('http');
var engine = torrentStream('magnet:?xt=urn:btih:283BD2E33EC85094789891A44CD5A3D2A2714205');
engine.on('ready', function() {
var file = engine.files[0];
file.select();
var server = http.createServer(function(req, res) {
file.createReadStream().pipe(res);
});
server.listen(7777);
console.log(server);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment