cleaning up an issue with client config generation

This commit is contained in:
2018-02-16 20:41:09 -05:00
parent 3978be8a40
commit ba0f076c66
3 changed files with 8 additions and 3 deletions

4
.vscode/tasks.json vendored
View File

@@ -12,9 +12,9 @@
]
},
{
"taskName": "Build GopherJS",
"taskName": "goReleaser Snapshot",
"type": "shell",
"command": "C:/Users/deranjer/go/bin/gopherjs.exe build C:/Users/deranjer/GoglandProjects/torrent-project/public/static/js/frontend-websocket.go",
"command": "C:/Users/deranjer/go/bin/goreleaser.exe -rm-dist -snapshot",
"problemMatcher": [
"$go"
]

View File

@@ -36,6 +36,10 @@ func GenerateClientConfigFile(config FullClientSettings, authString string) {
const ClientUsername = "` + config.ClientUsername + `"
const ClientPassword = "` + config.ClientPassword + `"
`
} else {
webUIAuth = `
const LoginRequired = false
`
}
if config.UseProxy {

View File

@@ -192,6 +192,7 @@ func main() {
router.HandleFunc("/websocket", func(w http.ResponseWriter, r *http.Request) { //websocket is the main data pipe to the frontend
conn, err := upgrader.Upgrade(w, r, nil)
fmt.Println("Websocket connection here")
defer conn.Close() //defer closing the websocket until done.
if err != nil {
Logger.WithFields(logrus.Fields{"error": err}).Fatal("Unable to create websocket!")