hackney_http_connect (hackney v4.4.2)
View SourceSummary
Functions
Close a socks5 socket.
Assign a new controlling process Pid to Socket.
Atoms used to identify messages in {active, once | true} mode.
Return the address and port for the other end of a connection.
TLS options for the proxy leg. Add SNI for the proxy host unless the user already set one or the proxy is addressed by IP literal (RFC 6066 forbids SNI for IP literals).
Receive a packet from a socket in passive mode.
Send a packet on a socket.
Set one or more options for a socket.
Immediately close a socket in one or two directions.
Get the local address and port of a socket
Types
-type http_socket() :: {atom(), inet:socket()}.
Functions
-spec close(http_socket()) -> ok.
Close a socks5 socket.
See also: gen_tcp:close/1.
-spec controlling_process(http_socket(), pid()) -> ok | {error, closed | not_owner | atom()}.
Assign a new controlling process Pid to Socket.
See also: gen_tcp:controlling_process/2.
Atoms used to identify messages in {active, once | true} mode.
-spec peername(http_socket()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, atom()}.
Return the address and port for the other end of a connection.
See also: inet:peername/1.
TLS options for the proxy leg. Add SNI for the proxy host unless the user already set one or the proxy is addressed by IP literal (RFC 6066 forbids SNI for IP literals).
-spec recv(http_socket(), non_neg_integer(), timeout()) -> {ok, any()} | {error, closed | atom()}.
Receive a packet from a socket in passive mode.
See also: gen_tcp:recv/3.
-spec send(http_socket(), iolist()) -> ok | {error, atom()}.
Send a packet on a socket.
See also: gen_tcp:send/2.
-spec setopts(http_socket(), list()) -> ok | {error, atom()}.
Set one or more options for a socket.
See also: inet:setopts/2.
-spec shutdown(http_socket(), read | write | read_write) -> ok.
Immediately close a socket in one or two directions.
See also: gen_tcp:shutdown/2.
-spec sockname(http_socket()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, atom()}.
Get the local address and port of a socket
See also: inet:sockname/1.