mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2026-05-23 20:33:46 -07:00
Merge pull request #65 from da4nik/connect-fix
Fixed host completion in 'connect'
This commit is contained in:
@@ -70,12 +70,12 @@ func connect(host, user, passwd string) (net.Conn, error) {
|
|||||||
if strings.TrimSpace(host) == "" {
|
if strings.TrimSpace(host) == "" {
|
||||||
a := strings.SplitN(user, "@", 2)
|
a := strings.SplitN(user, "@", 2)
|
||||||
if len(a) == 2 {
|
if len(a) == 2 {
|
||||||
host = a[1]
|
addr = a[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
a := strings.SplitN(host, ":", 2)
|
a := strings.SplitN(host, ":", 2)
|
||||||
if len(a) == 1 {
|
if len(a) == 1 {
|
||||||
host += ":5222"
|
addr += ":5222"
|
||||||
}
|
}
|
||||||
proxy := os.Getenv("HTTP_PROXY")
|
proxy := os.Getenv("HTTP_PROXY")
|
||||||
if proxy == "" {
|
if proxy == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user