(w http.ResponseWriter, r *http.Request)
| 8 | type HandlerFunc func(StreamID, io.Writer) |
| 9 | |
| 10 | func (h HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 11 | id := StreamID(r.FormValue(":streamid")) |
| 12 | w.WriteHeader(http.StatusOK) |
| 13 | |
| 14 | conn, _, err := w.(http.Hijacker).Hijack() |
| 15 | if err != nil { |
| 16 | w.WriteHeader(http.StatusInternalServerError) |
| 17 | return |
| 18 | } |
| 19 | |
| 20 | defer conn.Close() |
| 21 | h(id, conn) |
| 22 | } |