From e881ebfad17c4391281320eb424d29b894bb5e32 Mon Sep 17 00:00:00 2001 From: insanity Date: Mon, 31 Jul 2017 17:11:49 +0900 Subject: [PATCH] handle port binding err --- config.json | 2 +- main.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index 0b2a307..2af9db1 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "server": { - "addr": ":80", + "addr": ":8094", "tls": false }, "websocket": { diff --git a/main.go b/main.go index b515dfc..e18e057 100644 --- a/main.go +++ b/main.go @@ -57,8 +57,9 @@ func main() { http.Handle("/rpc", ws.HTTPHandler()) log.Printf("Address: %s, UseTLS: %t", addr, useTLS) - http.ListenAndServe(addr, nil) - + if err := http.ListenAndServe(addr, nil); err != nil { + log.Fatal(err) + } } func loadConfig() *config.Config {