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

madprabh's avatar

Reverb error

Hey foks so I am trying to use reverb but running into this issue.

The event triggers and in the logs I see this:

Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:8080/apps/673429/events?auth_key=****&auth_timestamp=1748544859&auth_version=1.0&body_md5=a416d1caedd8832364d5a753e8bca398&auth_signature=e151e0551da399991114ba2b10572403d12087ed29ec68eedba5f2089920b281.

My browser is able to connect to the server

{"event":"pusher:connection_established","data":"{\"socket_id\":\"863642737.836216913\",\"activity_timeout\":30}"}	114	
11:51:20.794
{"event":"pusher:subscribe","data":{"auth":"","channel":"tracker-created"}}	75	
11:51:20.821
{"event":"pusher_internal:subscription_succeeded","data":"{}","channel":"tracker-created"}

My nginx config file

My front-end code

Echo.channel('tracker-created')
    .listen('TrackerCreated', (e) => {
        console.log('TrackerCreated event received:');
    });

My env file

BROADCAST_CONNECTION=reverb
REVERB_APP_ID=****
REVERB_APP_KEY=****
REVERB_APP_SECRET=****
REVERB_HOST="localhost"
REVERB_PORT=8080
REVERB_SCHEME=http

#vite
VITE_REVERB_APP_KEY=${REVERB_APP_KEY}
VITE_REVERB_HOST=${REVERB_HOST}
VITE_REVERB_PORT=${REVERB_PORT}
VITE_REVERB_SCHEME=${REVERB_SCHEME}

What am I doing wrong?

0 likes
1 reply
LaryAI's avatar

Based on your description and logs, the error:

Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:8080/apps/673429/events?auth_key=...

means that your Laravel backend (when broadcasting events) cannot reach the Reverb server at localhost:8080. Even though your browser can connect, PHP (running inside your container or on your host) may not be able to.

This is a common issue when using Docker or similar setups. Here’s how to debug and solve it:


1. Check Where Laravel is Running

  • If Laravel is running in a Docker container, localhost refers to the container itself, not your host machine.
  • If Reverb is running on your host, you need to use the host's network IP, not localhost.

2. Solution: Use the Correct Host

If using Docker for Laravel:

  • Change your .env:
REVERB_HOST=host.docker.internal
  • host.docker.internal is a special DNS name that resolves to the host machine from inside Docker containers (works on Docker Desktop for Mac/Windows, and recent Docker for Linux).

If not using Docker:

  • Make sure Reverb is running and listening on localhost:8080.
  • From your terminal, try:
    curl http://localhost:8080
    
    If you get a response, the server is up.

3. Check Firewall and Bind Address

  • Make sure Reverb is listening on 0.0.0.0:8080 (not just 127.0.0.1:8080) if you want it accessible from other containers or machines.
  • In your Reverb config, set:
    REVERB_HOST=0.0.0.0
    
    and restart Reverb.

4. Update Your Frontend Vite Config

  • If you change the host, update your Vite variables as well:
    VITE_REVERB_HOST=host.docker.internal
    

5. Restart Everything

  • After changing .env, run:
    php artisan config:clear
    php artisan cache:clear
    

6. Summary Table

Where Laravel Runs Where Reverb Runs REVERB_HOST Value
Host Host localhost
Docker Host host.docker.internal
Docker Docker reverb (service name)

Example: Docker Compose Setup

If both Laravel and Reverb are in Docker Compose, use the service name:

REVERB_HOST=reverb

Final Checklist

  • Ensure Reverb is running and accessible from where PHP runs.
  • Use the correct REVERB_HOST in your .env.
  • Clear Laravel config/cache after changes.
  • If using Docker, prefer host.docker.internal or the service name.

If you still have issues, please specify:

  • Are you using Docker for Laravel? For Reverb?
  • What OS are you on?

Let me know if you need more help!

Please or to participate in this conversation.