Post Pic

WordPress: Fetch file through proxy

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!

Related Posts

Related Posts

No related posts.

14 Responses

Sep 07 2009 10:22

API link could be made combined with text and active, I didn’t mean for description to be copypasted directly. :)

Sep 08 2009 11:59

Could you explain the whole post in a bit more detail.

Sep 08 2009 17:10

@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…

Sep 08 2009 17:39

Is this similar to using a RSS feed? Sorry – Im a little lost…

Sep 09 2009 08:03

@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.

Sep 09 2009 15:37

Thanks for clearing that up – I follow what youre saying 100% now!

Sep 10 2009 19:40

You could fetch file with the program such as XAMMP…. CMIIW. great share, thanks.

Sep 10 2009 20:12

@Andreas Bambang

Well, this reipe is exactly for XAMP and other local stacks. It kinda says that in post. :) You are welcome!

Sep 21 2009 10:09

Useful for corporate intranets or something like that. =)

Dec 28 2009 19:20

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.

Dec 29 2009 00:14

@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:

Leave a Comment

* Name, Email, Comment are Required