Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pusher trigger not working in Development Server but works fine in local #7

Open
RJayalakshmi opened this issue Mar 29, 2014 · 8 comments

Comments

@RJayalakshmi
Copy link

Hi,

Please help me to fix this issue.

i got pusher chat real time application from the tutorial http://code.tutsplus.com/tutorials/getting-real-time-with-pusher--net-22106.

Above tutorial works fine in my local Wamp server. i have moved same code to host server in that trigger new_message event not working.

$pusher->trigger(
'presence-nettuts', //the channel
'new_message', //the event
array('message' => $message) //the data to send
);

above line returns 1 in local and returns none/empty in host server.

Please guide me if need any host server configuration needed?

sorry for my bad English.

@zimbatm
Copy link
Contributor

zimbatm commented Mar 31, 2014

The pusher library depends on curl to be available in PHP so maybe that's the difference. Try running phpinfo() on the server to see if that's the case.

The trigger function also accepts a debug flag. You can then print the output of the operation. This might as well give you a clue of what is happening.

$out = $pusher->trigger(
'presence-nettuts', //the channel
'new_message', //the event
array('message' => $message), //the data to send
null,
true
);
// display $out

@robhawkes
Copy link
Contributor

@Indians, are you still experiencing this problem?

@himanshuc3
Copy link

I am working on a real time timetable scheduler on MERN stack using Pusher. Somehow the req and response is coming and going fine, but the pusher trigger is not working(my assumption as axios is not getting any error and infact sending 200 status code).
My code is available here: https://github.com/himanshuc3/LiveTable

@gsofter
Copy link

gsofter commented Jun 5, 2020

I have the same problem with him.
While working on Express server on my local, the pusher trigger is working fine however, when I
upload this project to heroku, nothing is triggered.
Exactly, the pusher_app_id, pusher_app_secret, such all credentials are the same with local and the heroku server.

Anybody who knows the reason?

@gsofter
Copy link

gsofter commented Jun 5, 2020

Hey, @himanshuc3
I have tried to change the cluster of the Pusher app.
When we create the Pusher app, we can choose cluster which represents your region.
By default, it may be set affected by your local region.
For example, if you live in India, the cluster will be ap3 which means Asian Pacific 3 ( Mumbai) Region.

So in my case, I created another Pusher app and set cluster as us3 which will work for Heroku.
Now it's working fine.
Hope it will also work for your case.

@alex-cory
Copy link

For me, I had to remove these from my config

const pusher = new Pusher({
  appId: 'APP_ID',
  key: 'APP_KEY',
  secret: process.env.PUSHER_SECRET,
  cluster: 'us2',
  // these two were causing pusher.trigger to not work on deployed server
  // useTLS: true
  // encrypted: true
})

@jabir20102
Copy link

set BROADCAST_DRIVER=pusher on heroku config veriables

@EzekielWachira
Copy link

set BROADCAST_DRIVER=pusher on heroku config veriables

This one worked for me, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants