Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2014-06-05 05:32:45 +0400
committerFeross Aboukhadijeh <feross@feross.org>2014-06-05 05:32:45 +0400
commitbb51259cf0fc818e66206f6136f8c3c41d3fa301 (patch)
tree1123c035f3965fa82e4fc7f88e27943d839f40bb /bin
parentb20c8e96a3d258d549aa0c5c783ce623684d8e5f (diff)
make http server optional; emit 'listening'
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index fa2abb3..4d1adde 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -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
})