wilr / silverstripe-googlesitemaps

Google Sitemaps module for the SilverStripe CMS
BSD 3-Clause "New" or "Revised" License
74 stars 95 forks source link

GoogleSitemap::ping() cannot be piped through CWP egres proxy #156

Closed smindel closed 5 years ago

smindel commented 5 years ago

GoogleSitemap::ping() cannot be piped through CWP egres proxy, because fsockopen doesn't use stream_context_set_default():

https://www.cwp.govt.nz/developer-docs/en/2/how_tos/external_http_requests_with_proxy

smindel commented 5 years ago

CWP requires all outgoing traffic to travel through an egres proxy. The choice of native PHP function to send the update requests to Google and Bing (fsockopen) does not support the configuring of proxies, e.g. default stream contexts easily and connection details like URLs and ports are hard coded in the module.

smindel commented 5 years ago

The result is that you get the following errors: [error-log] E_WARNING: fsockopen(): unable to connect to www.google.com:80 (Network is unreachable) [error-log] E_WARNING: fsockopen(): unable to connect to www.bing.com:80 (Network is unreachable)

wilr commented 5 years ago

PR welcome.

smindel commented 5 years ago

Here you go: #157