Tuesday, March 21, 2017

Pusher does not work on DigitalOcean.com

I want to integrate Pusher into Laravel 5.4. I installed "pusher/pusher-php-server: 2.6" via Composer and this is the code I use to send message:

$options = ['cluster' => 'eu', 'encrypted' => true];
$pusher = new Pusher(env('PUSHER_KEY'), env('PUSHER_SECRET'), env('PUSHER_APP_ID'), $options);
$pusher->trigger('59', 'invitation', ['battle' => 19]);

It works perfectly from my local environment but does not work on DigitalOcean server. 404 NOT FOUND is returned every time. This is the logged message from pusher:

Pusher: ->trigger received string channel "59". Converting to array.
Pusher: create_curl( https://api-eu.pusher.com:443/apps//events?auth_key=&auth_signature=00229d21a6e0e18a854c0732149c306941f46c500d9a8851253bed1821e94f79&auth_timestamp=1490101277&auth_version=1.0&body_md5=42717e3ecc7f7ea6a9c720529330cfb8 )
Pusher: trigger POST: {"name":"invitation","data":"{\"battle\":19}","channels":["59"]}
Pusher: exec_curl response: Array ([body] => 404 NOT FOUND [status] => 404)

Can you tell me what could be causing the problem?



via Alien

Advertisement