
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.

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!
14 Responses
API link could be made combined with text and active, I didn’t mean for description to be copypasted directly.
Could you explain the whole post in a bit more detail.
@Akshay
What are you having problem with exactly?
There are, well, many details about how WordPress uses wrapper functions to select supported method to fetch file, etc, etc…
Is this similar to using a RSS feed? Sorry – Im a little lost…
@Abe
When you are using external RSS feed (for example via RSS widget) WordPress has to download actual feed file.
So if you are running WordPress on computer that has Internet access through proxy server you have to setup these so WP can download files from Internet.
Thanks for clearing that up – I follow what youre saying 100% now!
You could fetch file with the program such as XAMMP…. CMIIW. great share, thanks.
@Andreas Bambang
Well, this reipe is exactly for XAMP and other local stacks. It kinda says that in post.
You are welcome!
Useful for corporate intranets or something like that. =)
Why would wee need proxy to fecth files? what are we trying to hide here? Am I missing the point somewhere? Obviously its useful as the option is there, I thinks I’m just lost.
@Mark Humblings
WP can be run in environment where Internet access is only available through proxy. And it needs connectivity for internal things (like update checks) and for things included in themes (like embedded feeds).
Trackbacks: