Improve websocket writer

This commit is contained in:
世界
2022-09-23 17:21:24 +08:00
parent abe3dc6039
commit 22ea878fe9
6 changed files with 144 additions and 18 deletions

View File

@@ -108,10 +108,7 @@ func (s *Server) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
}
var metadata M.Metadata
metadata.Source = sHttp.SourceAddress(request)
conn = &WebsocketConn{
Conn: wsConn,
remoteAddr: metadata.Source.TCPAddr(),
}
conn = NewServerConn(wsConn, metadata.Source.TCPAddr())
if len(earlyData) > 0 {
conn = bufio.NewCachedConn(conn, buf.As(earlyData))
}