Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go hijack client connection

Tags:

go

go-http

Go language http connection hijacking.

I know how to hijack on server side. http://golang.org/pkg/net/http/#example_Hijacker

But is there way to hijack it on clients side?

like image 225
Max Avatar asked May 22 '14 16:05

Max


1 Answers

No, you can't do this with the default http.Client, but net/http/httputil has a ClientConn, which is a low level http client that directly wraps a net.Conn. It's Hijack-able, and operates on standard http.Request's.

http://golang.org/pkg/net/http/httputil/#ClientConn

Also, since you control both sides, and you shouldn't see anything too unexpected, it may be easier to simply write the request yourself directly to the TCP connection (or use Request.Write() if you want to build the request that way)

like image 177
JimB Avatar answered Oct 12 '22 21:10

JimB