google/cloud-bigquery 1.39.3 లో REST డెలివరీ మరియు token అభ్యర్థన hooks proxy తెలిసిన PSR అభ్యర్థన handler ను పంచుకోగలవు:

$proxy = 'http://proxy.example:8080';
$http = new \GuzzleHttp\Client();
$send = static function (
    \Psr\Http\Message\RequestInterface $request,
    array $options = []
) use ($http, $proxy) {
    $options['proxy'] = $proxy;
    return $http->send($request, $options);
};

$bigQuery = new \Google\Cloud\BigQuery\BigQueryClient([
    'projectId' => $projectId,
    'httpHandler' => $send,
    'authHttpHandler' => $send,
]);

callable ప్రతి అభ్యర్థనపై Guzzle యొక్క proxy ఎంపికను సెట్ చేస్తుంది, HTTP proxy జాబితా నుండి ఎంచుకున్న పబ్లిక్ HTTP endpoint తో సహా, మరియు constructor ఆ callable ను httpHandler మరియు authHttpHandler రెండింటికీ ఇస్తుంది. ఇది REST డెలివరీ మరియు ఆ hook ఉపయోగించే ప్రామాణీకరణ అభ్యర్థనలను కవర్ చేస్తుంది. మద్దతు ఉన్న credential సెటప్ ను ఉంచండి; వేరే transport ఉన్న credential కోసం ఆ transport కూడా తనిఖీ చేయాలి.

అవసరమైన ప్రత్యక్ష మినహాయింపులను Guzzle మద్దతు ఇచ్చే proxy కాన్ఫిగరేషన్ ద్వారా జోడించండి. BigQuery API endpoint ను సేవా గమ్యస్థానంగా ఉంచండి: apiEndpoint లో proxy చిరునామా పెట్టడం ఈ మార్గాన్ని కాన్ఫిగర్ చేయకుండా వేరే సేవను ఎంచుకుంటుంది.

ఇవి BigQueryClient constructor ఎంపికలు. ఇవి స్వతంత్ర gRPC ఛానెల్ ను కాన్ఫిగర్ చేయవు మరియు ప్రత్యేక Google API PHP Client లైబ్రరీలోని Google\Client యొక్క setHttpClient ఇంటర్ఫేస్ తో కూడా సరిపోవు.

సంబంధిత వ్యాసాలు