I've built a plugin that uses AJAX to post a URL to the URL2PNG API and bring back a screenshot into WordPress via wp_remote_get. It works beautifully in my development environment. In production, though, it needs to go through a proxy.
Here's where it got sticky.
We defined the proxy via wp-config and it worked beautifully. In my testing I was able to successfully connect to the URL2PNG API via the proxy and return results..
When the request originated via AJAX, no success.
I've gone through extensive testing and here's what I've found:
Requests originating directly in plugin (e.g. on page load) are routed properly through the proxy without trouble.
Requests that start in the browser (e.g. via AJAX) fail to connect.
Closer inspection by server support showed that the request was attempting to go direct and not making use of the proxy.
Have any of you run into this before? Any ideas what may be going on?