diff options
Diffstat (limited to 'server/lib/webtorrent.js')
-rw-r--r-- | server/lib/webtorrent.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/server/lib/webtorrent.js b/server/lib/webtorrent.js index bcd30139e..2090b792b 100644 --- a/server/lib/webtorrent.js +++ b/server/lib/webtorrent.js | |||
@@ -1,15 +1,14 @@ | |||
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | const config = require('config') | ||
4 | const ipc = require('node-ipc') | 3 | const ipc = require('node-ipc') |
5 | const pathUtils = require('path') | 4 | const pathUtils = require('path') |
6 | const spawn = require('electron-spawn') | 5 | const spawn = require('electron-spawn') |
7 | 6 | ||
7 | const constants = require('../initializers/constants') | ||
8 | const logger = require('../helpers/logger') | 8 | const logger = require('../helpers/logger') |
9 | 9 | ||
10 | const electronDebug = config.get('electron.debug') | 10 | let host = constants.CONFIG.WEBSERVER.HOST |
11 | let host = config.get('webserver.host') | 11 | let port = constants.CONFIG.WEBSERVER.PORT |
12 | let port = config.get('webserver.port') | ||
13 | let nodeKey = 'webtorrentnode' + port | 12 | let nodeKey = 'webtorrentnode' + port |
14 | let processKey = 'webtorrentprocess' + port | 13 | let processKey = 'webtorrentprocess' + port |
15 | ipc.config.silent = true | 14 | ipc.config.silent = true |
@@ -59,7 +58,7 @@ function create (options, callback) { | |||
59 | 58 | ||
60 | const webtorrentProcess = spawn(pathUtils.join(__dirname, 'webtorrent-process.js'), host, port, { detached: true }) | 59 | const webtorrentProcess = spawn(pathUtils.join(__dirname, 'webtorrent-process.js'), host, port, { detached: true }) |
61 | 60 | ||
62 | if (electronDebug === true) { | 61 | if (constants.CONFIG.ELECTRON.DEBUG === true) { |
63 | webtorrentProcess.stderr.on('data', function (data) { | 62 | webtorrentProcess.stderr.on('data', function (data) { |
64 | logger.debug('Webtorrent process stderr: ', data.toString()) | 63 | logger.debug('Webtorrent process stderr: ', data.toString()) |
65 | }) | 64 | }) |