BigQuery PHP ના REST અને auth હૂક્સને proxy handler આપો
google/cloud-bigquery 1.39.3 માટે, જ્યારે બંને માર્ગોને મધ્યસ્થની જરૂર હોય ત્યારે httpHandler અને authHttpHandler ને એ જ callable આપો.
google/cloud-bigquery 1.39.3 માં REST ડિલિવરી અને token વિનંતીના હૂક્સ 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 ડિલિવરી અને તે હૂક વાપરતી પ્રમાણીકરણ વિનંતીઓને આવરી લે છે. સમર્થિત credential સેટઅપ રાખો; અલગ transport ધરાવતા credential માટે તે transport પણ તપાસવો પડે છે.
જરૂરી સીધા અપવાદો Guzzle ની સમર્થિત proxy રૂપરેખા દ્વારા ઉમેરો. BigQuery API endpoint ને સેવાનું લક્ષ્ય રાખો: apiEndpoint માં proxy સરનામું મૂકવું આ માર્ગને ગોઠવવાને બદલે અલગ સેવા પસંદ કરે છે.
આ BigQueryClient constructor વિકલ્પો છે. તે સ્વતંત્ર gRPC ચેનલ ગોઠવતા નથી કે અલગ Google API PHP Client લાઇબ્રેરીમાં Google\Client ના setHttpClient ઇન્ટરફેસને અનુરૂપ પણ નથી.