imroc / req

Simple Go HTTP client with Black Magic
https://req.cool
MIT License
4.12k stars 334 forks source link

Hijack H1 Connection (e.g. for using as Websocket) #305

Open powellnorma opened 7 months ago

powellnorma commented 7 months ago

I think all that would be needed is that the persistConn gets "removed". E.g. decConnsPerHost would have to be called I think, maybe more?

I think the http.Hijacker interface could be implemented for this?

Is there currently any way to establish a WS Connection using imroc/req?

Thank you!

imroc commented 7 months ago

websocket is not currently supported

powellnorma commented 7 months ago

Can you please give me a pointer into how to implement http.Hijacker for T1 in my modified version of imroc/req?

Once I have the pc from getConn, is it enough to use decConnsPerHost, so that req "forgets" about this pc, and I can just return the pc.conn (to implement http.Hijacker) ?