[erlang-questions] Hackney socket
Wed Dec 24 18:45:23 CET 2014
On Wed, Dec 24, 2014 at 12:40 PM, Roberto Ostinelli <>
> I'm using hackney to send a HTTPS request. The server I'm connecting to
> will keep the resulting TCP connection open, so that it then becomes a
> two-way communication channel using HTTP chunk.
> I therefore need to retrieve the Socket from a Connection Reference, so I
> can send chunked data into it.
> Does anyone know what is the cleanest way to retrieve the underlying
> socket from a Connection Reference?
If you want to reuse the socket and cancel the request then you can use
`hackney:cancel_request/1` . Note that you can directly send chunks using
hackney if you specify the Tranfer-Encoding header. Hackney will take care
about it. It also works if you want to stream the request.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions