Types
Example: "localhost" or "foo.bar.se"
Example: 8080
Example: "*.ericsson.se"
Example: "134.138" or "[FEDC:BA98" (all IP addresses starting with 134.138 or FEDC:BA98), "66.35.250.150" or "[2010:836B:4179::836B:4179]" (a complete IP address).
proxy
defaults to
{undefined, []}
, that is, no proxy is configured and
https_proxy
defaults to the value of
proxy
. Maximum number of persistent connections to a host. Default is
2
. Maximum number of outstanding requests on the same connection to a host. Default is
5
. If a persistent connection is idle longer than the
keep_alive_timeout
in milliseconds, the client closes the connection. The server can also have such a time-out but do not take that for granted. Default is
120000
(= 2 min). Maximum number of outstanding requests on a pipelined connection to a host. Default is
2
. If a persistent connection is idle longer than the
pipeline_timeout
in milliseconds, the client closes the connection. Default is
0
, which results in pipelining not being used. If cookies are enabled, all valid cookies are automatically saved in the cookie database of the client manager. If option
verify
is used, function
store_cookies/2
has to be called for the cookies to be saved. Default is
disabled
. Default is
inet
. With
inet6fb4
option, IPv6 will be preferred but if connection fails, an IPv4 fallback connection attempt will be made. If the host has several network interfaces, this option specifies which one to use. See
gen_tcp:connect/3,4
for details. Local port number to use. See
gen_tcp:connect/3,4
for details. The options are appended to the socket options used by the client. These are the default values when a new request handler is started (for the initial connect). They are passed directly to the underlying transport (
gen_tcp
or
SSL
)
without verification. Default is
false
. This option is used to switch on (or off) different levels of Erlang trace on the client. It is a debug feature. When started
stand_alone
only the pid can be used. Experimental option for sending HTTP requests over a unix domain socket. The value of
unix_socket
shall be the full path to a unix domain socket file with read/write permissions for the erlang process. Default is
undefined
.
Sets options to be used for subsequent requests.
Note
If possible, the client keeps its connections alive and uses persistent connections with or without pipeline depending on configuration and current circumstances. The HTTP/1.1 specification does not provide a guideline for how many requests that are ideal to be sent on a persistent connection. This depends much on the application.
A long queue of requests can cause a user-perceived delay, as earlier requests can take a long time to complete. The HTTP/1.1 specification suggests a limit of two persistent connections per server, which is the default value of option max_sessions
.
The current implementation assumes the requests to the same host, port combination will use the same socket options.