Skip to content

Instantly share code, notes, and snippets.

@FLYBYME
Created April 2, 2013 00:49
Show Gist options
  • Save FLYBYME/5289082 to your computer and use it in GitHub Desktop.
Save FLYBYME/5289082 to your computer and use it in GitHub Desktop.
/**
* Module dependencies and config.
*/
var express = require('express')
var rTorrent = require('rtorrent')
var rt = new rTorrent({
host : 'localhost',
port : 80,
path : '/RPC2'
});
rt.details(function(err, torrents) {
console.log('your list of torrents', torrents);
})
var app = module.exports = express();
app.get('/', function(req, res) {
res.send('Hello World');
console.log('page render');
});
app.listen(3000);
console.log('Listening on port 3000');
@FLYBYME
Copy link
Author

FLYBYME commented Apr 2, 2013

I have not used rtorrent with nginx.

If you can get to rtorrent with xmlrpc using the server ip/url then use it with you config.

something like.

var rTorrent = require('rtorrent')

var rt = new rTorrent({
    host : '192.168.1.20',
    port : 5000,
    path : '/RPC2'
});
rt.details(function(err, torrents, raw) {
    if(err) throw err;
    console.log('your list of torrents', torrents, raw);
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment