WordPress: Fetch file through proxy

September 7, 2009 at 9:48 am

Running local WordPress stack is common for development purposes. Such environment is quite different from hosting server and one of issues for me was making WordPress fetch RSS feed with Internet access through proxy server.

Turns out WP HTTP API http://codex.wordpress.org/HTTP_API (wrapper functions for all file-fetching) already has proxy support. Only need to define proxy server settings in wp-config.php (if no login needed just omit lines)

define('WP_PROXY_HOST', '');
define('WP_PROXY_PORT', '');
define('WP_PROXY_USERNAME', '');
define('WP_PROXY_PASSWORD', '');

Thanks to Rarst for sharing this very recipe with us!