fix: connection reset without any closing handshake on clientside (#2709)

This commit is contained in:
Théo Monnom
2024-05-11 13:39:17 +02:00
committed by GitHub
parent eef3cf0f01
commit 9887d32bd2
+2
View File
@@ -317,6 +317,8 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
defer func() {
// when the source is terminated, this means Participant.Close had been called and RTC connection is done
// we would terminate the signal connection as well
closeMsg := websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")
_ = conn.WriteControl(websocket.CloseMessage, closeMsg, time.Now().Add(time.Second))
_ = conn.Close()
}()
defer func() {