00979: Cannot configure a proxy server
Description: I have been trying to get a number of the RSS feed recipes to work and so far none of them have. This is because the Wiki is sat behind the company proxy server, I can't find any documentation to configure PmWiki to use the proxy server.
Is there a way this can be done or is it a feature request?
This is a very old post and I'll close it but will give some pointers in case they are needed. If someone still requires this function added for one of the recipes, I'd be happy to look into it.
It is technically possible to fetch a resource via proxy, but the recipes will probably need to be rewritten.
Here is a sample function that can fetch a resource via a proxy.
// Proxy settings, set in config.php Local proxy IP and port $FeedProxy = 'tcp://127.0.0.1:8080'; function proxy_get_content($feed_url) { global $FeedProxy; // Create a stream context with the proxy $context = stream_context_create([ 'http' => [ 'proxy' => $FeedProxy, 'request_fulluri' => true, ], ]); // Fetch the RSS feed with the proxy context $response = file_get_contents($feed_url, false, $context); // Return the response or false if an error occurred return $response !== false ? $response : null; }
Then, update the recipe to call proxy_get_content($url)
when fetching the feed, possibly with a conditional on existing $FeedProxy
. --Petko