Component evidence

NewClient (client.go)

fasthttp/websocket · client.go · go · BSD-2-Clause
realtime

Implements configurable WebSocket client dialing with TLS, proxies, subprotocols, compression, cookies, and handshake controls.

Source preview first 800 characters · full source over MCP
// Source: https://github.com/fasthttp/websocket | License: BSD-2-Clause | Copyright 2013 The Gorilla WebSocket Authors. All rights reserved
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package websocket

import (
	"bytes"
	"context"
	"crypto/tls"
	"errors"
	"fmt"
	"io"
	"net"
	"net/http"
	"net/http/httptrace"
	"net/url"
	"strings"
	"time"
)

// ErrBadHandshake is returned when the server response to opening handshake is
// invalid.
var ErrBadHandshake = errors.New("websocket: bad handshake")

var errInvalidCompression = errors.New("websocket: invalid compression negotiation")

// NewClient creates

... (truncated -- full source via MCP)