summaryrefslogtreecommitdiff
path: root/bilibili/connect.go
blob: de608d01f43f81b3c6c33aed2ecb5b7bf9efaf9e (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
}