fix: cluster 支持ipv6地址字符串 (#2124)

Co-authored-by: zhuyin.zhu <zhuyin.zhu@bytedance.com>
This commit is contained in:
IAN.Z
2025-12-26 12:35:29 +08:00
committed by GitHub
parent a4c6e04ab0
commit 1bbdeb3132
2 changed files with 5 additions and 2 deletions

View File

@@ -408,7 +408,8 @@ end
function socket.listen(host, port, backlog)
if port == nil then
host, port = string.match(host, "([^:]+):(.+)$")
host, port = string.match(host, "(.+):([^:]+)$")
host = host:match("^%[(.-)%]$") or host
port = tonumber(port)
end
local id = driver.listen(host, port, backlog)