Short and sweet, there’s an http_api_curl
action that you can use. You should obviously inspect things to make sure that you are on the right request, too, but you should get the gist.
add_action(
'http_api_curl',
static function ($resource, $request, $url) {
curl_setopt($resource, CURLOPT_PROXY, 'http://localhost:7080'); // PROXY details with port
},
10,
3
);