WordPress Proxysupport

Who is using WordPress in an intranet environment, will quickly realize, that despite internet connection, no feed content gets loaded in the backend. In general, it’s because of the proxy of the company. So far WordPress wasn’t particularly flexible in this case. As of WordPress 2.8 that will change and new constants make ensure that you now can enter the proxy directly to wp-config.php.

Until WordPress 2.7

Up to this version of WordPress it works only with an adjustment in the core, in wp-includes/class-snoopy.php. Here you have to change the settings of $proxy_host, $proxy_port and $_isproxy. The value of var $_isproxy = false; will of course have TRUE as value.

var $host       = "www.php.net"; // host name we are connecting to
var $port       = 8080; // port we are connecting to
var $proxy_host = ""; // proxy host to use
var $proxy_port = ""; // proxy port to use
var $proxy_user = ""; // proxy user to use
var $proxy_pass = ""; // proxy password to use
var $_isproxy   = true; // set if using a proxy server

WordPress 2.8

With the new version it is much easier, because no more intrusion into the core files is necessary and the possibility to define the values in the configuration file wp-config.php.

define('WP_PROXY_HOST', '192.168.84.101');
define('WP_PROXY_PORT', '8080');
define('WP_PROXY_USERNAME', 'my_user_name');
define('WP_PROXY_PASSWORD', 'my_password');
define('WP_PROXY_BYPASS_HOSTS', 'localhost, www.example.com');

Various references are also inTicket 4011.


Posted

in

by

Comments

13 responses to “WordPress Proxysupport”

  1. […] Support for proxy. Helpful, if your installation is in an intranet. […]

  2. […] WordPress Proxy Support – WP Engineer […]

  3. […] Proxysupport – WordPress, define’WPPROXYPASSWORD […]

  4. Marek Avatar

    Thanks for sharing. I will try figure out how to add this to my WP blog

  5. […] Proxysupport – WordPress, define’WPPROXYPASSWORD … tweetmeme_url = […]

  6. Proxy Address Avatar
    Proxy Address

    Im confused, is this for making a wordpress installation a proxy bypass, or using wordpress on an intranet to create a proxy ?

  7. Jan Avatar
    Jan

    Thanks Frank for this one, I was losing my time hopelessly modifying class-snoopy in a >= 2.8 WP install.

    @2: This is for making certain parts of WordPress work behind a proxy (ie. the plugin manager, rss feeds on the admin dashboard)…

  8. Brad Avatar

    Can/do plugins make use of these settings? I’m sitting behind an authenticated proxy and have had difficulty getting things like flickr plugins to work, and I’m thinking that it’s probably the proxy/firewall that’s stopping them. Does anyone have much experience with plugins in >2.8 and proxies?

  9. Alex Avatar
    Alex

    Thanx a lot for this brief, but working explanation !!!

  10. Will Avatar
    Will

    Thanks for posting this!

    Saved me a log of headache.

  11. Craig Avatar
    Craig

    Where do you put this code in the php file? Anywhere in particular?

    Thanks,

  12. Martin Allert Avatar

    It does not seem to work – when I hit the plugins update button, wordpress presents a ftp/ftps selection dialogue.