Only do ensurePort for XMPP transport

If we always do this the address gets mangled, breaking the transport
selection.
disco_info_form
Wichert Akkerman 5 years ago committed by Mickaël Rémond
parent a189748b9c
commit 8fb3e33a1f

@ -133,8 +133,6 @@ func NewClient(config Config, r *Router) (c *Client, err error) {
}
}
}
config.Address = ensurePort(config.Address, 5222)
c = new(Client)
c.config = config
c.router = r

@ -39,5 +39,7 @@ func NewTransport(config TransportConfiguration) Transport {
if strings.HasPrefix(config.Address, "ws:") || strings.HasPrefix(config.Address, "wss:") {
return &WebsocketTransport{Config: config}
}
config.Address = ensurePort(config.Address, 5222)
return &XMPPTransport{Config: config}
}

Loading…
Cancel
Save