Close the websocket connection once the webrtc connection is established

This commit is contained in:
Jacob Stewart
2023-04-24 11:17:08 -04:00
parent 3af1a5a631
commit ed1a1e3e08
2 changed files with 2 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ func Dial(address string, tlsConfig *tls.Config) (*Conn, error) {
if err != nil {
return nil, err
}
defer wSock.Close()
// Offer WebRtc Upgrade
var candidatesMux sync.Mutex

View File

@@ -145,7 +145,7 @@ func (l *Listener) attemptWebRtcNegotiation(wsConn net.Conn) {
// Register channel opening handling
d.OnOpen(func() {
printDataChannel(d)
wsConn.Close()
l.pendingAccepts <- conn
})