I'm writing a server in go and need to get a cam video in a ffmpeg client and passes the streaming to websocket users.

But in my code, the http body received from the ffmpeg client is loaded by a ioutil.ReadAll and cannot make a live broadcast because the body is receiving new values with the video capture. How i can take the last frame of the video, send to the websockets, clean the variable and receive the new frame correctly (or i'm doing in the wrong way)?

Here is my code to this function:

//StartClientStream needs a email$clientName$streamName
func StartClientStream(w http.ResponseWriter, r *http.Request) {

    values := strings.Split(string(mux.Vars(r)["rest"]), "$")

    if len(values) != 3 {
        w.Write([]byte(`{"err":"the passed value does not match with necessary fields"}`))
        return
    }
    //Get user ID
    id, _ := getID(values[0])
    //Take the streaming ClientName
    clientName := id + " - " + values[1]
    //Take the passed Body
    body, _ := ioutil.ReadAll(r.Body)
    //Watch for websockets requests for this video
    for user := range Streaming.User[clientName] {
        conexoes := strings.Split(Streaming.User[clientName][user], "-")
        for c := range conexoes {
            if strings.EqualFold(conexoes[c], values[2]) {
                //Send the video
                user.send <- body
            }
        }
    }

}