Improve tls writer

This commit is contained in:
世界
2022-09-30 11:27:18 +08:00
parent 968430c338
commit 1173fdea64
16 changed files with 358 additions and 39 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, Writer: &Writer{conn, false}}, nil
return &WebsocketConn{Conn: conn, Writer: NewWriter(conn, false)}, nil
}
return nil, wrapDialError(response, err)
} else {