Closed MohamedSR closed 3 years ago
Do you receive any more information in the stack trace about why the connection is refused (for e.g a certificate error)?
Do you get the same error when TLS is set to false - 'useTLS' => false
?
It sounds like something is blocking traffic between your shared host and Pusher. Can you issue a ping to api-eu.pusher.com
?
If you are not getting responses on the pings, you could try the same thing with traceroute, e.g. traceroute api-eu.pusher.com
(depending on your OS etc). That would tell you what's blocking the traffic.
Do you receive any more information in the stack trace about why the connection is refused (for e.g a certificate error)? Do you get the same error when TLS is set to false -
'useTLS' => false
?
at StreamHandler->__invoke(object(Request), array('http_errors' => false, 'base_uri' => 'https://api-eu.pusher.com:443', 'synchronous' => true, 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => 5, 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'decode_content' => true, 'verify' => true, 'cookies' => false, 'idn_conversion' => false)) in PrepareBodyMiddleware.php line 64
at PrepareBodyMiddleware->__invoke(object(Request), array('http_errors' => false, 'base_uri' => 'https://api-eu.pusher.com:443', 'synchronous' => true, 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => 5, 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'decode_content' => true, 'verify' => true, 'cookies' => false, 'idn_conversion' => false)) in Middleware.php line 31
at Middleware::GuzzleHttp{closure}(object(Request), array('http_errors' => false, 'base_uri' => 'https://api-eu.pusher.com:443', 'synchronous' => true, 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => 5, 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'decode_content' => true, 'verify' => true, 'cookies' => false, 'idn_conversion' => false)) in RedirectMiddleware.php line 71
at RedirectMiddleware->__invoke(object(Request), array('http_errors' => false, 'base_uri' => 'https://api-eu.pusher.com:443', 'synchronous' => true, 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => 5, 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'decode_content' => true, 'verify' => true, 'cookies' => false, 'idn_conversion' => false)) in Middleware.php line 61
at Middleware::GuzzleHttp{closure}(object(Request), array('http_errors' => false, 'base_uri' => 'https://api-eu.pusher.com:443', 'synchronous' => true, 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => 5, 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'decode_content' => true, 'verify' => true, 'cookies' => false, 'idn_conversion' => false)) in HandlerStack.php line 75
at HandlerStack->__invoke(object(Request), array('http_errors' => false, 'base_uri' => 'https://api-eu.pusher.com:443', 'synchronous' => true, 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => 5, 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'decode_content' => true, 'verify' => true, 'cookies' => false, 'idn_conversion' => false)) in Client.php line 331
at Client->transfer(object(Request), array('http_errors' => false, 'base_uri' => 'https://api-eu.pusher.com:443', 'synchronous' => true, 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => 5, 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'decode_content' => true, 'verify' => true, 'cookies' => false, 'idn_conversion' => false)) in Client.php line 168
at Client->requestAsync('POST', object(Uri), array('query' => array('auth_key' => 'xxxxxxx', 'auth_timestamp' => 1616525290, 'auth_version' => '1.0', 'body_md5' => 'xxxxxxxx', 'auth_signature' => 'xxxxxxxxxx'), 'http_errors' => false, 'base_uri' => 'https://api-eu.pusher.com:443', 'synchronous' => true, 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => 5, 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'decode_content' => true, 'verify' => true, 'cookies' => false, 'idn_conversion' => false, '_conditional' => array('User-Agent' => 'GuzzleHttp/7')))
in Client.php line 187
at Client->request('POST', '/apps/xxxxxxxxx/events', array('query' => array('auth_key' => 'xxxxxx', 'auth_timestamp' => 1616525290, 'auth_version' => '1.0', 'body_md5' => 'xxxxxx', 'auth_signature' => 'xxxxxxxxxx'), 'headers' => array('Content-Type' => 'application/json', 'X-Pusher-Library' => 'pusher-http-php 6.0.1'), 'body' => '{"name":"new-order","data":"\"vous avez une nouvelle commande ref: xxxxxxxx-70\"","channels":["livresto"]}', 'http_errors' => false, 'base_uri' => 'https://api-eu.pusher.com:443', 'synchronous' => true)) in ClientTrait.php line 95
at Client->post('/apps/xxxxxx/events', array('query' => array('auth_key' => 'xxxxxxxxxxxxxxx', 'auth_timestamp' => 1616525290, 'auth_version' => '1.0', 'body_md5' => 'xxxxxxxxxxxx', 'auth_signature' => 'xxxxxxxx'), 'headers' => array('Content-Type' => 'application/json', 'X-Pusher-Library' => 'pusher-http-php 6.0.1'), 'body' => '{"name":"new-order","data":"\"vous avez une nouvelle commande ref: 1616525290-70\"","channels":["livresto"]}', 'http_errors' => false, 'base_uri' => 'https://api-eu.pusher.com:443'))in Pusher.php line 408 at Pusher->trigger(array('livresto'), 'new-order', 'vous avez une nouvelle commande ref: 1616525290-70')in PusherEvent.php line 26
It sounds like something is blocking traffic between your shared host and Pusher. Can you issue a ping to
api-eu.pusher.com
?If you are not getting responses on the pings, you could try the same thing with traceroute, e.g.
traceroute api-eu.pusher.com
(depending on your OS etc). That would tell you what's blocking the traffic.
Unfortunately my shared host doent provide ssh
In that case I am not sure how to proceed. This doesn't sound like a problem with the Pusher SDK, but rather your environment. I would suggest you somehow verify whether this server allows outgoing traffic on port 443 or 80.
If someone is managing this server for you, you might be able to ask them to investigate?
In that case I am not sure how to proceed. This doesn't sound like a problem with the Pusher SDK, but rather your environment. I would suggest you somehow verify whether this server allows outgoing traffic on port 443 or 80.
If someone is managing this server for you, you might be able to ask them to investigate?
Yes it's not related to the SDK though it works well on localhost, i asked them to investigate and i am waiting for the response
It works well when i change the cluser from eu to mt1, Thanks @elverkilde and @ben-pusher :)
Actually it's not a bug, i received Connection refused on shared host though it work fine on localhost
----- My configuration -------------
----- My event solution 1 -------
---- my event solution 2 -------------
----- How i trigger the event ----------
event(new PusherEvent("new-order",$message));
------ Response received -----------
Connection refused for URI http://api-eu.pusher.com/apps/xxxxxx/events?auth_key=xxxxxxxxx&auth_timestamp=1616497319&auth_version=1.0&body_md5=xxxxxxxxxxxxxxxxx&auth_signature=xxxxxxxxxxxxxxxxxxxxxxxxx