Use net.JoinHostPort and net.SplitHostPort for IPv6-safe host:port handling (#5836)

This commit is contained in:
Viktor Liu
2026-04-10 09:10:57 +08:00
committed by GitHub
parent 0cc90e2a8a
commit f484835292
21 changed files with 193 additions and 36 deletions
+1 -1
View File
@@ -337,7 +337,7 @@ func runTurnDataTransfer(t *testing.T, testData []byte) time.Duration {
func getTurnClient(t *testing.T, address string, conn net.Conn) (*turn.Client, error) {
t.Helper()
// Dial TURN Server
addrStr := fmt.Sprintf("%s:%d", address, 443)
addrStr := net.JoinHostPort(address, "443")
fac := logging.NewDefaultLoggerFactory()
//fac.DefaultLogLevel = logging.LogLevelTrace
+1 -1
View File
@@ -52,7 +52,7 @@ func AllocateTurnClient(serverAddr string) *TurnConn {
func getTurnClient(address string, conn net.Conn) (*turn.Client, error) {
// Dial TURN Server
addrStr := fmt.Sprintf("%s:%d", address, 443)
addrStr := net.JoinHostPort(address, "443")
fac := logging.NewDefaultLoggerFactory()
//fac.DefaultLogLevel = logging.LogLevelTrace