haskell-grpc-native / http2-client

A native HTTP2 client in Haskell
BSD 3-Clause "New" or "Revised" License
43 stars 27 forks source link

Provide a way to open a frame connection over a raw socket #69

Closed refi64 closed 5 years ago

refi64 commented 5 years ago

I'm hoping to use http2-client-grpc with unix domain sockets, but http2-client doesn't provide anything like frameHttp2RawConnection publicly, so there's no way to do this right now...

lucasdicioccio commented 5 years ago

Hi! it shoul be doable. Do you mind trying to implement a constructor for Network.HTTP2.Client.RawConnection over unix domain sockets?

hint: it would likely look like https://hackage.haskell.org/package/http2-client-0.9.0.0/docs/src/Network.HTTP2.Client.RawConnection.html#newRawHttp2Connection with different hints

refi64 commented 5 years ago

So if there were a constructor for RawConnection, there would also have to be a FrameConnection that uses it as well, right?

lucasdicioccio commented 5 years ago

Correct. There's a hidden function named frameHttp2RawConnection :: RawHttp2Connection -> ClientIO Http2FrameConnection in the Network.HTTP2.Client.FrameConnection module. If you have time to write a patch do not hesitate to export this function from that module.