mirror of
https://github.com/zoriya/flood.git
synced 2026-06-02 11:06:35 +00:00
@@ -13,7 +13,8 @@ It's a work-in-progress, and it might not have all of the features you want (yet
|
||||
* I recommend managing different Node versions with [nvm](https://github.com/creationix/nvm) or [n](https://github.com/tj/n).
|
||||
|
||||
#### Configuration
|
||||
1. Add your rTorrent SCGI hostname and port in `config.js`. Defaults are `localhost` and `5000`.
|
||||
1. Set your rTorrent SCGI hostname and port in `config.js`. Defaults are `localhost` and `5000`.
|
||||
* If you want to use a socket, change `socket` to true and set `socketPath` to the absolute file path of your rTorrent socket, make sure Flood has read/write access.
|
||||
2. Copy `server/db/users.js.example` to `server/db/users.js` and add a username and password (password is stored in plain text for now, but this file is not accessible publicly).
|
||||
|
||||
#### Start It
|
||||
|
||||
@@ -3,8 +3,12 @@ const config = {
|
||||
dbPath: './server/db/',
|
||||
maxHistoryStates: 30,
|
||||
pollInterval: 1000 * 5,
|
||||
scgiHost: 'localhost',
|
||||
scgiHostPort: 5000
|
||||
scgi: {
|
||||
host: 'localhost',
|
||||
port: 5000,
|
||||
socket: false,
|
||||
socketPath: '/tmp/rtorrent.sock'
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
|
||||
+4
-1
@@ -9,11 +9,14 @@ let config = require('../../config');
|
||||
|
||||
let scgi = {
|
||||
methodCall: (methodName, parameters) => {
|
||||
let connectMethod = config.scgi.socket
|
||||
? {path: config.scgi.socketPath}
|
||||
: {port: config.scgi.port, host: config.scgi.host};
|
||||
let deferred = Q.defer();
|
||||
let deserializer = new Deserializer('utf8');
|
||||
let headerLength = 0;
|
||||
let nullChar = String.fromCharCode(0);
|
||||
let stream = net.connect({port: config.scgiHostPort, host: config.scgiHost});
|
||||
let stream = net.connect(connectMethod);
|
||||
let xml = Serializer.serializeMethodCall(methodName, parameters);
|
||||
|
||||
stream.setEncoding('UTF8');
|
||||
|
||||
Reference in New Issue
Block a user