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