add cli flag to disable DHT

This partially addresses #3.
This commit is contained in:
Jimmy Zelinskie 2015-03-22 18:24:31 -04:00
parent 0f4478115e
commit 8cc582ecb2
1 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,7 @@ var (
// TODO: Check the default torrent listen port.
listenAddr = flag.String("listenAddr", ":50007", "incoming connection address")
disableTrackers = flag.Bool("disableTrackers", false, "disable trackers")
disableDHT = flag.Bool("disableDHT", false, "disable DHT")
seed = flag.Bool("seed", false, "seed after downloading")
upload = flag.Bool("upload", true, "upload data to peers")
)
@ -43,6 +44,7 @@ func main() {
DisableTrackers: *disableTrackers,
ListenAddr: *listenAddr,
NoUpload: !*upload,
NoDHT: *disableDHT,
})
if err != nil {
log.Fatalf("error creating client: %s", err)