more
This commit is contained in:
parent
939a8cee96
commit
0828fc3df1
2
main.go
2
main.go
|
@ -46,13 +46,13 @@ func (h *httpProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Error(w, "hijack disallowed", http.StatusInternalServerError)
|
http.Error(w, "hijack disallowed", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
conn, _, err := hijacker.Hijack()
|
conn, _, err := hijacker.Hijack()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
outConn.Close()
|
outConn.Close()
|
||||||
http.Error(w, err.Error(), http.StatusServiceUnavailable)
|
http.Error(w, err.Error(), http.StatusServiceUnavailable)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
w.WriteHeader(http.StatusOK)
|
|
||||||
go transfer(conn, outConn)
|
go transfer(conn, outConn)
|
||||||
go transfer(outConn, conn)
|
go transfer(outConn, conn)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue