Add implementation of telegram dialer

This commit is contained in:
9seconds
2021-03-22 12:30:23 +03:00
parent 69203f3e23
commit 7108fe99ec
3 changed files with 131 additions and 5 deletions
+3 -5
View File
@@ -43,11 +43,9 @@ func (n *network) DialContext(ctx context.Context, protocol, address string) (ne
return nil, fmt.Errorf("cannot resolve dns names: %w", err)
}
if len(ips) > 1 {
rand.Shuffle(len(ips), func(i, j int) {
ips[i], ips[j] = ips[j], ips[i]
})
}
rand.Shuffle(len(ips), func(i, j int) {
ips[i], ips[j] = ips[j], ips[i]
})
var conn net.Conn
for _, v := range ips {