diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2014-06-05 05:32:45 +0400 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2014-06-05 05:32:45 +0400 |
commit | bb51259cf0fc818e66206f6136f8c3c41d3fa301 (patch) | |
tree | 1123c035f3965fa82e4fc7f88e27943d839f40bb /bin | |
parent | b20c8e96a3d258d549aa0c5c783ce623684d8e5f (diff) |
make http server optional; emit 'listening'
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/cmd.js | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -103,7 +103,10 @@ if (argv.subtitles) { var client = new WebTorrent({ list: argv.list, quiet: true, - blocklist: argv.blocklist + blocklist: argv.blocklist, + port: (argv.vlc || argv.mplayer || argv.omx) + ? argv.port + : false }) var started = Date.now() @@ -114,15 +117,7 @@ client.on('error', function (err) { process.exit(1) }) -client.once('ready', function () { - client.server.once('error', function () { - client.server.listen(0) - }) - - client.server.listen(argv.port) -}) - -client.server.once('listening', function () { +client.once('listening', function () { listening = true }) |