diff options
author | Wim <wim@42.be> | 2016-07-17 22:15:19 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2016-07-17 22:15:19 +0200 |
commit | 5fe4b749cfb56ca5f499abaaba76e0292e1d04fa (patch) | |
tree | f93662752ba037d01f8bc2384d31f44e8dc23741 /matterhook | |
parent | 6991d85da9b1b687d1dd2ec15b83fd2d378ec63b (diff) | |
download | matterbridge-msglm-5fe4b749cfb56ca5f499abaaba76e0292e1d04fa.tar.gz matterbridge-msglm-5fe4b749cfb56ca5f499abaaba76e0292e1d04fa.tar.bz2 matterbridge-msglm-5fe4b749cfb56ca5f499abaaba76e0292e1d04fa.zip |
Do not check bindaddress when not using the server
Diffstat (limited to 'matterhook')
-rw-r--r-- | matterhook/matterhook.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/matterhook/matterhook.go b/matterhook/matterhook.go index ef983e7b..fc003cce 100644 --- a/matterhook/matterhook.go +++ b/matterhook/matterhook.go @@ -60,15 +60,15 @@ type Config struct { // New Mattermost client. func New(url string, config Config) *Client { c := &Client{Url: url, In: make(chan IMessage), Out: make(chan OMessage), Config: config} - _, _, err := net.SplitHostPort(c.BindAddress) - if err != nil { - log.Fatalf("incorrect bindaddress %s", c.BindAddress) - } tr := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: config.InsecureSkipVerify}, } c.httpclient = &http.Client{Transport: tr} if !c.DisableServer { + _, _, err := net.SplitHostPort(c.BindAddress) + if err != nil { + log.Fatalf("incorrect bindaddress %s", c.BindAddress) + } go c.StartServer() } return c |