fix: 修复监听 accept 退避与握手前超时上限

This commit is contained in:
Nixevol
2026-09-30 16:21:51 +08:00
parent 8ca545ae99
commit c0b2903ab7
7 changed files with 484 additions and 14 deletions
+2
View File
@@ -4,6 +4,7 @@ import (
"context"
"net"
"net/http"
"time"
"git.asio.asia/nixevol/NixMsg/internal/listener"
"github.com/coder/websocket"
@@ -36,6 +37,7 @@ func (b *Broker) WSHandler(proxies *listener.ProxySet) http.Handler {
nc = listener.WithRemoteAddr(nc, &net.TCPAddr{IP: net.ParseIP(ip)})
}
}
_ = nc.SetReadDeadline(time.Now().Add(10 * time.Second))
_ = b.AttachWS(nc)
})
}