[erlang-questions] did cowboy_req:transport/1 go missing ?

Loïc Hoguin <>
Fri Jan 11 15:55:22 CET 2013

On 01/11/2013 03:49 PM, AD wrote:
> i have the latest master checkout of cowboy and it looks like
> cowboy_req:transport/1 went missing.  The in code docs reference it
> exists but its not defined.  Any thoughts ?
> %% Exceptions include <em>chunk/2</em> which always returns <em>'ok'</em>,
> %% <em>to_list/1</em> which returns a list of key/values,
> %% and <em>transport/1</em> which returns <em>{ok, Transport, Socket}</em>.

Forgot to remove that from the docs!


[Socket, Transport] = cowboy_req:get([socket, transport], Req)

if you need it.

If you are using response streaming, you don't need it anymore as the 
Socket and Transport are now passed to the fun.

Loïc Hoguin
Erlang Cowboy
Nine Nines

More information about the erlang-questions mailing list