Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CrastyCrap's avatar

Test Pusher webhook at localhost

i need to catch client event that came from pusher the problem is the project is still in developing phase so i need to test it on localhost so is there is a method will will hlp me to use webhook on local

0 likes
2 replies
LaryAI's avatar
Level 58

Yes, you can use a tool like ngrok to expose your local server to the internet and receive webhooks from Pusher. Here's how you can do it:

  1. Download and install ngrok from https://ngrok.com/download.
  2. Start your local server and note the port number it's running on (e.g. 8000).
  3. Open a terminal window and navigate to the directory where you installed ngrok.
  4. Run the following command to start ngrok and expose your local server:
./ngrok http 8000
  1. Ngrok will generate a unique URL that you can use to access your local server from the internet. Look for the "Forwarding" section in the ngrok console output and copy the HTTPS URL (e.g. https://12345678.ngrok.io).
  2. Go to your Pusher dashboard and add the ngrok URL as a webhook endpoint for your app.
  3. Test your webhook by triggering a client event in your app and verifying that it's received by your local server.

Note that ngrok generates a new URL every time you start it, so you'll need to update your webhook endpoint in the Pusher dashboard each time you restart ngrok.

Please or to participate in this conversation.