mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Use a proxy server for the PagerDuty transport. (#12294)
* Use a proxy server for the PagerDuty transport. We don't use the get_guzzle_proxy() function since tcp:// doesn't work with all of the HTTP transports that Guzzle supports. Instead we use the standard get_proxy() function. Tested against Squid * formatting only
This commit is contained in:
@ -70,8 +70,11 @@ class Pagerduty extends Transport
|
||||
$url = 'https://events.pagerduty.com/v2/enqueue';
|
||||
$client = new Client();
|
||||
|
||||
$request_opts = ['json' => $data];
|
||||
$request_opts['proxy'] = get_proxy();
|
||||
|
||||
try {
|
||||
$result = $client->request('POST', $url, ['json' => $data]);
|
||||
$result = $client->request('POST', $url, $request_opts);
|
||||
|
||||
if ($result->getStatusCode() == 202) {
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user