summaryrefslogtreecommitdiff
path: root/bilibili/connect.go
blob: 472c979b6fad56debde3a05605df323a0f0230ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package bilibili

import (
	"context"
	"nhooyr.io/websocket"
)

func (b Bilibili) DialWebSocket(ctx context.Context, url string) (*websocket.Conn, error) {
	ws, _, err := websocket.Dial(ctx, url, &websocket.DialOptions{
		HTTPClient: b.http,
	})
	return ws, err
}