Commit 1e57587f authored by astaxie's avatar astaxie

support Hijacker #428

parent 383a04f4
package beego
import (
"bufio"
"errors"
"fmt"
"net"
"net/http"
"net/url"
"os"
......@@ -864,3 +867,13 @@ func (w *responseWriter) WriteHeader(code int) {
w.started = true
w.writer.WriteHeader(code)
}
// hijacker for http
func (w *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
hj, ok := w.writer.(http.Hijacker)
if !ok {
println("supported?")
return nil, nil, errors.New("webserver doesn't support hijacking")
}
return hj.Hijack()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment