Dial creates a new WebSocket connection to the given url with the given options. The passed context bounds the maximum time spent waiting for the connection to open. The returned *http.Response is always nil or a mock. It's only in the signature to match the core API.
(ctx context.Context, url string, opts *DialOptions)
| 288 | // The returned *http.Response is always nil or a mock. It's only in the signature |
| 289 | // to match the core API. |
| 290 | func Dial(ctx context.Context, url string, opts *DialOptions) (*Conn, *http.Response, error) { |
| 291 | c, resp, err := dial(ctx, url, opts) |
| 292 | if err != nil { |
| 293 | return nil, nil, fmt.Errorf("failed to WebSocket dial %q: %w", url, err) |
| 294 | } |
| 295 | return c, resp, nil |
| 296 | } |
| 297 | |
| 298 | func dial(ctx context.Context, url string, opts *DialOptions) (*Conn, *http.Response, error) { |
| 299 | if opts == nil { |
nothing calls this directly
no test coverage detected
searching dependent graphs…