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

Rrrob's avatar
Level 1

Reverb stuck on port 5173

Hi

I'm new to laravel so please forgive my ignorance, i've spent the past two weeks trying to understand enough to at least ask a question that is relevant to my problem!

I've built a demo project and tried to add reverb but couldn't get it to work, I was originally using a cli sail command which set up docker containers in docker, but it seemed from reading that I needed it to be secure and that the webserver this uses doesn't do that, and also that my server needs to be able to respond on /app on the right port, which requires additional configuration that can only be done with a different web server such as nginx as used by herd, so i switched over to that, given that the reverb tutorials i followed were not really that complicated it seemed like the issue must lie somewhere in the server config or something like that.. So i spent a while looking into this and had added a forward from port 443 to 8080, which from what I now understand may actually still be correct,

I was able to secure the site etc and get it all running again quite easily using herd, however, my echo.js would still never connect.. but i noticed the client.js did, eventually I realised this is the vite-hmr hot reload thing that is updating the page when i make changes in the code and save, I was so confused how this could be doing what I wanted to but I couldn't make the same thing work at all!

Obviously I started looking into these requests and the differences between them, i noticed my failing echo.js is trying the /app path with all the extra query parameters and the reverb app id, and the client.js is calling my local .test domain on port 5173... 5173.... 🤔 Hang on... echo.js is ALSO trying to connect on 5173... should this not be 443 or something i've specified in that config? echo.js: wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,

.env:
VITE_REVERB_PORT="${REVERB_PORT}"
REVERB_PORT=443

I don't specify 5173 anywhere in my code, and from reading online, this is the default VITE port, (it even spells it) Nothing I try to do to make my echo.js connect on another port seems to work, it ALWAYS uses 5173:

As a result I thought fine, you want 5173, have it!! and added a directive into the nginx config to listen on 127.0.0.1:5173 and
location ~ /app/(?.*) { # variable reverbkey proxy_pass http:// 127.0.0.1:8080/app/$reverbkey;....

I then found I can run wscat-c wss://domain.test:5173/app/appid --no-check and it connects and shows the connection in my reverb server session in --debug this also works on 443 which is the port i was expecting it to use (but i could be wrong)

Then when i run npm run dev it says it cant use 5173, and will use 5174 instead However, the site now won't work as it complains about CORS and that it can't read the remote resource at https:// domain.test:5174/resources/js/app.js

if i instead run npm run dev --port 5174 it says '(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.' OR IF I DONT RUN IT... then the vite initiator never appears, but my reverb connection does.. and it works!! Of course it is still on 5173 ?!

I have a feeling if I could just get echo.js to try :443 as specified, and then vite / client js stays on 5173 it would work, but they just seem to be stuck on the same port, how can I change that ?!?

TLDR: why does my reverb ALWAYS try to connect on port 5173 which seems to be the default vite port, even when I'm not running the vite server,

Thanks for your help, it's much appreciated

0 likes
4 replies
Rrrob's avatar
Level 1

Of course the moment after i posted this I found vite.config.js I added in a port to that and fiddled about a bit, didn't really think I changed anything other than that but then on changing it back it still wouldn't work! It was suddenly trying 'localhost/app' and failing I narrowed this down to reverb host in the .env file which i have then changed from localhost to my test domain... I've since removed the port from the vite config so it's how it was originally, but somehow it seems to have fixed the issue, now my client.js connects on wss domain.test : 5174 my echo.js on wss domain.test / app / appid etc extremely confusing !!

Rrrob's avatar
Level 1

Hi again, it seems it only works on chrome , on firefox i still get a cors error :(

Rrrob's avatar
Level 1

I realised I have to go to the new vite port to accept the self signed certificate again in firefox! Doh! ok, so I can change the vite port to another one, specified as 5175 , at least it's working, but i don't get why i had to do all that, or why it didn't just use 443 instead of 5173

Rrrob's avatar
Level 1

Also if anyone else was having similar issues

The example I found online

location ~ ^/apps/(?[^/]+)/events$ { # variable reverbid proxy_pass http: //127.0.0.1:8123/apps/$reverbid/events; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; }

the line location ~ ^/apps/(?[^/]+)/events$ should be location ~ ^/apps/(?[^/]+)/events Also I had to change it to 8080

Please or to participate in this conversation.