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

@@ -74,7 +74,7 @@ func (c *Client) DialContext(ctx context.Context) (net.Conn, error) {
if c.maxEarlyData <= 0 {
conn, response, err := c.dialer.DialContext(ctx, c.uri, c.headers)
if err == nil {
return &WebsocketConn{Conn: conn}, nil
return &WebsocketConn{Conn: conn, Writer: &Writer{conn, false}}, nil
}
return nil, wrapDialError(response, err)
} else {