diff --git a/config.toml b/config.toml index b0ed24dc..cec4656c 100644 --- a/config.toml +++ b/config.toml @@ -1,7 +1,7 @@ [serverConfig] - ServerPort = "8000" #leave format as is it expects a string with colon - ServerAddr = "192.168.1.8" #Put in the IP address you want to bind to + ServerPort = "8000" #Required to input as string + ServerAddr = "192.168.1.8" #Put in the IP address you want to bind to as string LogLevel = "Debug" # Options = Debug, Info, Warn, Error, Fatal, Panic LogOutput = "file" #Options = file, stdout #file will print it to logs/server.log diff --git a/settings/settings.go b/settings/settings.go index 02944dc1..4714d8fd 100644 --- a/settings/settings.go +++ b/settings/settings.go @@ -217,12 +217,12 @@ func FullClientSettingsNew() FullClientSettings { // fmt.Println("Reading in custom DHT config") // dhtServerConfig = dhtServerSettings(dhtServerConfig) //} - strippedHTTPPort := strings.TrimPrefix(httpAddrPort, ":") - httpAddrPortInt64, err := strconv.ParseInt(strippedHTTPPort, 10, 0) + strippedDHTPort := strings.TrimPrefix(listenAddr, ":") + DHTPortInt64, err := strconv.ParseInt(strippedDHTPort, 10, 0) if err != nil { fmt.Println("Failed creating 64-bit integer for goTorrent Port!", err) } - httpAddrPortInt := int(httpAddrPortInt64) //converting to integer + DHTPortInt := int(DHTPortInt64) //converting to integer encryptionPolicy := torrent.EncryptionPolicy{ DisableEncryption: viper.GetBool("EncryptionPolicy.DisableEncryption"), @@ -233,7 +233,7 @@ func FullClientSettingsNew() FullClientSettings { tConfig := torrent.NewDefaultClientConfig() tConfig.DataDir = dataDirAbs - tConfig.ListenPort = httpAddrPortInt + tConfig.ListenPort = DHTPortInt tConfig.DisablePEX = disablePex tConfig.NoDHT = noDHT tConfig.NoUpload = noUpload @@ -246,9 +246,6 @@ func FullClientSettingsNew() FullClientSettings { tConfig.DisableIPv6 = disableIPv6 tConfig.Debug = debug tConfig.EncryptionPolicy = encryptionPolicy - if listenAddr != "" { - tConfig.SetListenAddr(listenAddr) //Setting the IP address to listen on - } Config := FullClientSettings{ LoggingLevel: logLevel,