feat(voice): use Dialer for connections (#1220)

Use Session.Dialer for WebSocket connections.
This commit is contained in:
Fedor Lapshin 2022-08-14 00:04:52 +03:00 committed by GitHub
parent f7309cdb9e
commit 7c87035a71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -304,7 +304,7 @@ func (v *VoiceConnection) open() (err error) {
// Connect to VoiceConnection Websocket
vg := "wss://" + strings.TrimSuffix(v.endpoint, ":80")
v.log(LogInformational, "connecting to voice endpoint %s", vg)
v.wsConn, _, err = websocket.DefaultDialer.Dial(vg, nil)
v.wsConn, _, err = v.session.Dialer.Dial(vg, nil)
if err != nil {
v.log(LogWarning, "error connecting to voice endpoint %s, %s", vg, err)
v.log(LogDebug, "voice struct: %#v\n", v)