Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple of changes to cmd.js #600

Closed
wants to merge 12 commits into from

Added --client-port argument.

- Use of 6881 as default value.
- Alias -c defined..

Signed-off-by: Vincent Frentzel <vincent@frentzel.eu>
  • Loading branch information
Vincent Frentzel
Vincent Frentzel committed Feb 7, 2016
commit e663bb021a080c1ad416d3d2ace541f3e4bcbc0f
@@ -40,6 +40,7 @@ var argv = minimist(process.argv.slice(2), {
alias: {
p: 'port',
b: 'blocklist',
c: 'client-port',
t: 'subtitles',
s: 'select',
i: 'index',
@@ -72,7 +73,8 @@ var argv = minimist(process.argv.slice(2), {
'on-exit'
],
default: {
port: 8000
port: 8000,
client-port: 6881
}
})

@@ -203,14 +205,15 @@ Options (simple):
-v, --version print the current version
Options (advanced):
-p, --port [number] change the http server port [default: 8000]
-t, --subtitles [path] load subtitles file
-b, --blocklist [path] load blocklist file/http url
-a, --announce [url] tracker URL to announce to
-q, --quiet don't show UI on stdout
--on-done [script] run script after torrent download is done
--on-exit [script] run script before program exit
--verbose show torrent protocol details
-p, --port [number] change the http server port [default: 8000]
-c, --client-port [number] change the torrent client port [default: 6881]
-t, --subtitles [path] load subtitles file
-b, --blocklist [path] load blocklist file/http url
-a, --announce [url] tracker URL to announce to
-q, --quiet don't show UI on stdout
--on-done [script] run script after torrent download is done
--on-exit [script] run script before program exit
--verbose show torrent protocol details
*/
}.toString().split(/\n/).slice(2, -2).join('\n'))
@@ -264,7 +267,9 @@ function runDownload (torrentId) {
argv.out = process.cwd()
}

client = new WebTorrent({ blocklist: argv.blocklist })
client = new WebTorrent({ blocklist: argv.blocklist,
torrentPort: argv.client-port })

client.on('error', fatalError)

var torrent = client.add(torrentId, { path: argv.out, announce: argv.announce })
@@ -479,7 +484,9 @@ function runSeed (input) {
return
}

client = new WebTorrent({ blocklist: argv.blocklist })
client = new WebTorrent({ blocklist: argv.blocklist,
torrentPort: argv.client-port })

client.on('error', fatalError)

client.seed(input, { announce: argv.announce }, function (torrent) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.