hackney_util (hackney v4.12.2)
View SourceSummary
Functions
Get the default protocols for HTTP connections. Returns the value of the default_protocols` application env, or `[http2, http1] if not set.
The caller's socket options to merge over a transport's own base options when it dials. Only gen_tcp/inet socket options are kept: connect_options also carries hackney's own entries for the proxy transports (on_connect_response, proxy_auth_fun, ...), and the framing options the transport reads its socket with (binary, active, packet, mode) stay the transport's.
filter a proplists and only keep allowed keys
The caller's socket options that apply to the UDP socket of an HTTP/3 connection, forwarded to quic as extra_socket_opts.
Start the given applications if they were not already started.
set the default options in a proplists if not defined
The socket options in a connect_options list: everything except the entries hackney reads itself. Used to key pooled and shared connections by the socket options they were opened with.
Functions
-spec default_protocols() -> [http3 | http2 | http1].
Get the default protocols for HTTP connections. Returns the value of the default_protocols` application env, or `[http2, http1] if not set.
The order determines preference: HTTP/2 is preferred, then HTTP/1.1.
To enable HTTP/3 (experimental):
application:set_env(hackney, default_protocols, [http3, http2, http1]).
The caller's socket options to merge over a transport's own base options when it dials. Only gen_tcp/inet socket options are kept: connect_options also carries hackney's own entries for the proxy transports (on_connect_response, proxy_auth_fun, ...), and the framing options the transport reads its socket with (binary, active, packet, mode) stay the transport's.
-spec filter_options([{atom(), any()} | {raw, any(), any(), any()}], [atom()], Acc) -> Acc when Acc :: [any()].
filter a proplists and only keep allowed keys
The caller's socket options that apply to the UDP socket of an HTTP/3 connection, forwarded to quic as extra_socket_opts.
-spec require([module()]) -> ok.
Start the given applications if they were not already started.
set the default options in a proplists if not defined
The socket options in a connect_options list: everything except the entries hackney reads itself. Used to key pooled and shared connections by the socket options they were opened with.