Reference

httpclient

Available since

  • HAProxy 2.5
  • HAProxy Enterprise 2.5r1

Display a list of available Runtime API commands.

Description Jump to heading

Launch an HTTP client request and print the response. Specify the HTTP method and the URL. This command is supported only in expert mode.

For versions 2.5r1 and 2.6r1, the URL must be specified as an IP address because the command does not resolve FQDNs.

As of version 2.7r1, the command can resolve a server name in the URL using the default resolvers section, which is populated with the DNS servers of your /etc/resolv.conf by default. However, the command cannot resolve a host from /etc/hosts if you do not use a local DNS daemon that can resolve them.

Warning

Expert mode commands require a build of the load balancer that has debugging enabled. The commands are for debugging or development purposes only and can cause abnormal termination of the load balancer process. Do not use expert mode commands except as directed by HAProxy Enterprise support or development personnel.

Example Jump to heading

Launch a GET request at http://192.168.20.10:

nix
echo "expert-mode on; httpclient GET http://192.168.20.10" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "expert-mode on; httpclient GET http://192.168.20.10" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999

See also Jump to heading

Do you have any suggestions on how we can improve the content of this page?