Skip to content

Instantly share code, notes, and snippets.

@JakubOboza
Created May 1, 2012 15:26
Show Gist options
  • Save JakubOboza/2568811 to your computer and use it in GitHub Desktop.
Save JakubOboza/2568811 to your computer and use it in GitHub Desktop.
raw request for torrent -> use pump to give it back.
var http = require('http');
var torrent = "http://torrents.thepiratebay.se/7232828/Alcatraz.S01E13.HDTV.x264-LOL.7232828.TPB.torrent";
var torrentto = "http://ca.isohunt.com/download/70161921/lol.torrent";
var options = {
host: 'torrents.thepiratebay.se',
port: 80,
path: '/7232828/Alcatraz.S01E13.HDTV.x264-LOL.7232828.TPB.torrent',
method: 'GET'
};
var optionsto = {
host: 'ca.isohunt.com',
port: 80,
path: '/download/70161921/lol.torrent',
method: 'GET'
};
var req = http.get(options, function(res) {
console.log('STATUS: ' + res.statusCode);
console.log('HEADERS: ' + JSON.stringify(res.headers));
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log('BODY: ' + chunk);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment