Closed Synergy-ek closed 3 years ago
Looking forward to know about using this library with a proxy
The FCM Request class do support custom a GuzzleHttp client; as per documentation Guzzlehttp do support proxy options (note: request options can be set on client initialization, this is the required approach on this library)
//Custom http client
$myClient = new Client([
'proxy' => [
'http' => 'tcp://localhost:8125', // Use this proxy with "http"
'https' => 'tcp://localhost:9124', // Use this proxy with "https",
'no' => ['.mit.edu', 'foo.com'] // Don't use a proxy with these
]
]);
$request->setHttpClient($myClient);
The ServiceAccount should contain only the service account informations, connection options should be set on the calling class (in this example the FCM request that can authorize the request with a custom client)
In case of using CURL with proxy or IP binding, options doesn't pushed to OAuth2 middleware. If set, custom HTTP client should be posted to CredentialsLoader::makeHttpClient() at src/ServiceAccount.php, line 69