5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 14:00:27 +00:00

Use API_URL_SUFFIX_V3 (mattermost)

This commit is contained in:
Wim 2017-03-25 21:05:02 +01:00
parent eacb1c1771
commit 95f4e3448e

View File

@ -159,11 +159,11 @@ func (m *MMClient) Login() error {
m.Client.SetTeamId(m.Team.Id) m.Client.SetTeamId(m.Team.Id)
// setup websocket connection // setup websocket connection
wsurl := wsScheme + m.Credentials.Server + model.API_URL_SUFFIX + "/users/websocket" wsurl := wsScheme + m.Credentials.Server + model.API_URL_SUFFIX_V3 + "/users/websocket"
header := http.Header{} header := http.Header{}
header.Set(model.HEADER_AUTH, "BEARER "+m.Client.AuthToken) header.Set(model.HEADER_AUTH, "BEARER "+m.Client.AuthToken)
m.log.Debug("WsClient: making connection") m.log.Debugf("WsClient: making connection: %s", wsurl)
for { for {
wsDialer := &websocket.Dialer{Proxy: http.ProxyFromEnvironment, TLSClientConfig: &tls.Config{InsecureSkipVerify: m.SkipTLSVerify}} wsDialer := &websocket.Dialer{Proxy: http.ProxyFromEnvironment, TLSClientConfig: &tls.Config{InsecureSkipVerify: m.SkipTLSVerify}}
m.WsClient, _, err = wsDialer.Dial(wsurl, header) m.WsClient, _, err = wsDialer.Dial(wsurl, header)