Repository navigation
Releases
v0.1.3
wp http-proxy check now shows the proxy it uses for the URL, or why it uses none, and names any proxy environment variable that cURL reads for the request. It prints the size of the response body. Add --body to print the body.
wp http-proxy status now says why the proxy is off. An http-proxy value that is not a block, such as a bare URL, now prints a warning.
The README now covers installing behind a proxy or without wp package install, updating and uninstalling, proxy login methods, proxies that inspect HTTPS, networks without public DNS, and troubleshooting. The package is now on Packagist. To report a security issue privately, see SECURITY.md.
Upgrade notes:
checkno longer prints the response body by default. Usewp http-proxy check <url> --bodyfor the previous output.statusadds the reason afterHTTP proxy: disabled, such asHTTP proxy: disabled (no http-proxy configuration).
Install:
wp package install ekamran/wp-cli-http-proxy-command:@stable
Updating from an earlier version with WP-CLI 2.12: wp package update keeps the installed release. Run the install command above again to move to v0.1.3.
Tested with WP-CLI 2.12.0 on PHP 7.2 and PHP 8.4, and WP-CLI nightly on PHP 8.5. Also tested end to end on the official wordpress:cli-php8.4 image, with WP-CLI 2.12.0 and nightly, through a Squid proxy that was the only way out of the network.
v0.1.2
Adds warnings when the proxy configuration cannot be used. A URL or host without a port, an invalid port, a configuration with no proxy address, or a scheme other than http:// leaves the proxy off with a warning that names the setting. Setting only a username or only a password also prints a warning.
A bare IPv6 address now works in the host setting, such as 2001:db8::1.
The README now covers localhost handling in WordPress core and WP-CLI, and HTTPS requests through a proxy when PHP has no cURL extension.
Upgrade note: a socks5:// or https:// proxy URL, including one read from an environment variable with env: true, is now ignored with a warning. Only HTTP proxies are supported, so use an http:// URL.
Install:
wp package install ekamran/wp-cli-http-proxy-command:@stable
Updating from an earlier version: wp package update keeps the installed release. Run the install command above again to move to v0.1.2.
Tested with WP-CLI 2.12.0 on PHP 7.2 and PHP 8.4, and WP-CLI nightly on PHP 8.5.
v0.1.1
Fixes wp http-proxy check inside WordPress installs older than 6.2. There WP-CLI uses the install's Requests 1.x, and the command failed with "WP-CLI returned an unexpected HTTP response." even though the request went through the proxy.
The README now explains how cURL's own handling of proxy environment variables, such as https_proxy and no_proxy, interacts with this package, and that wp package commands are not covered. wp help http-proxy now shows command descriptions.
Install:
wp package install ekamran/wp-cli-http-proxy-command:@stable
Updating from v0.1.0: if you installed with :@stable, wp package update keeps v0.1.0, because WP-CLI records the exact release it installed. Run the install command above again to move to v0.1.1.
Tested with WP-CLI 2.12.0 on PHP 7.2 and PHP 8.4, and WP-CLI nightly on PHP 8.5.
v0.1.0
First release.
Configures an opt-in HTTP proxy for WordPress core requests and WP-CLI requests made through its HTTP helper. Set it up with an http-proxy block in wp-cli.yml, and check it with wp http-proxy status and wp http-proxy check.
Install:
wp package install ekamran/wp-cli-http-proxy-command:@stable
Tested with WP-CLI 2.12.0 on PHP 7.2 and PHP 8.4, and WP-CLI nightly on PHP 8.5. See the README for configuration, compatibility notes and limitations.