Skip to content

Commit

Permalink
Add comment about candidate marshal in sfu-ws
Browse files Browse the repository at this point in the history
If you are serializing a candidate make sure to use ToJSON
Using Marshal will result in errors around `sdpMid`
  • Loading branch information
jason-shen authored and Sean-Der committed Oct 28, 2024
1 parent b4164e3 commit f3b8c43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sfu-ws/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ func websocketHandler(w http.ResponseWriter, r *http.Request) {
if i == nil {
return
}

// If you are serializing a candidate make sure to use ToJSON
// Using Marshal will result in errors around `sdpMid`
candidateString, err := json.Marshal(i.ToJSON())
if err != nil {
log.Println(err)
Expand Down

0 comments on commit f3b8c43

Please sign in to comment.