There is an export call:
cowboy_req:get(socket, Req)
It returns a socket or almost everything else in the object Req, currently:
bindings
body_state
buffer
connection
headers
host
host_info
meta
method
multipart
onresponse
path
path_info
peer
pid
port
qs
resp_body
resp_compress
resp_headers
resp_state
socket
transport
version
, , , , , unit test , , , - /, -. , .