From 8fb3e33a1f64cd9055cefbc547f1eeebecb06d30 Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Sat, 12 Oct 2019 15:49:22 +0200 Subject: [PATCH] Only do ensurePort for XMPP transport If we always do this the address gets mangled, breaking the transport selection. --- client.go | 2 -- transport.go | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 2c8cec9..7f56d0b 100644 --- a/client.go +++ b/client.go @@ -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 diff --git a/transport.go b/transport.go index 2abd3e3..3e0ca0d 100644 --- a/transport.go +++ b/transport.go @@ -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} }