|
|
|
@ -46,7 +46,16 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Try port 5222 if no xmpp-client SRV records are provided.
|
|
|
|
|
// Try port 5223 if directTLS is set and no xmpp-client SRV records are provided.
|
|
|
|
|
if directTLS {
|
|
|
|
|
options.NoTLS = false
|
|
|
|
|
options.StartTLS = false
|
|
|
|
|
options.Host = net.JoinHostPort(server, "5223")
|
|
|
|
|
// Connect to server
|
|
|
|
|
client, err := options.NewClient()
|
|
|
|
|
return client, err
|
|
|
|
|
} else {
|
|
|
|
|
// Try port 5222 if no xmpp-client SRV records are provided and directTLS is not set.
|
|
|
|
|
options.NoTLS = true
|
|
|
|
|
options.StartTLS = true
|
|
|
|
|
options.Host = net.JoinHostPort(server, "5222")
|
|
|
|
@ -54,6 +63,7 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
|
|
|
|
|
client, err := options.NewClient()
|
|
|
|
|
return client, err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Connect to server
|
|
|
|
|
client, err := options.NewClient()
|
|
|
|
|
return client, err
|
|
|
|
|