Only do ensurePort for XMPP transport

If we always do this the address gets mangled, breaking the transport
selection.
This commit is contained in:
Wichert Akkerman 2019-10-12 15:49:22 +02:00 committed by Mickaël Rémond
parent a189748b9c
commit 8fb3e33a1f
2 changed files with 2 additions and 2 deletions

View File

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

View File

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