整理代码

This commit is contained in:
injoyai
2025-03-18 16:43:20 +08:00
parent 296b7197a1
commit 31fcc0b3a3

View File

@@ -3,6 +3,7 @@ package tdx
import ( import (
"context" "context"
"github.com/injoyai/ios" "github.com/injoyai/ios"
"github.com/injoyai/ios/module/tcp"
"github.com/injoyai/logs" "github.com/injoyai/logs"
"math/rand" "math/rand"
"net" "net"
@@ -10,6 +11,13 @@ import (
"time" "time"
) )
func NewTCPDial(addr string) ios.DialFunc {
if !strings.Contains(addr, ":") {
addr += ":7709"
}
return tcp.NewDial(addr)
}
func NewHostDial(hosts []string) ios.DialFunc { func NewHostDial(hosts []string) ios.DialFunc {
if len(hosts) == 0 { if len(hosts) == 0 {
hosts = Hosts hosts = Hosts