-
Notifications
You must be signed in to change notification settings - Fork 98
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
Don't connect the form to the server socket #78
Comments
where does |
If you don't have an SSL certificate for the domain (common for local development), you should set the |
If you start the server with the |
+1 here as well. Same issue - Herd Pro, using reverb service, with SSL (via Herd)...
|
Turning off SSL in Herd, changing the APP_URL to http..., and updating the .env settings for Reverb:
Got this working locally. Likely an issue with the SSL. I saw in the docs you could target the SSL cert by entering it in the settings, going to mess around and see if that fixes it. |
I can confirm @fylzero findings - Removing SSL on Herd and setting Using SSL is a different story. I can get a connection with the following below with SSL switched on in Herd, however it seems to disconnect after 30ish seconds with the same APP_URL=https://reverb-test.test
REVERB_APP_ID=1001
REVERB_APP_KEY=laravel-herd
REVERB_APP_SECRET=secret
REVERB_HOST="reverb-test.test"
REVERB_PORT=8080
REVERB_SCHEME=https # Force TLS |
I just ran through the SSL setup with the following steps and am able to connect (FF, Safari and Chrome) with no issues over wss using the following steps:
Reverb lets me know I'm starting a secure server: And I'm able to connect: @aj-norman, if you're seeing Echo trying to connect to 0.0.0.0, it's likely you either haven't rebuilt your frontend since updating @fylzero The built-in Reverb service doesn't have SSL support (yet). |
I believe it must be something in the migration from Laravel 10 to 11, I had 10 with laravel websockets running fine, but after the update I'm no longer able to do so.
|
@joedixon - Apologies, I should have made it clearer above - I changed the
|
@lsdevelop that's not the Reverb socket server, that's part of the Vite dev server which is why you don't see it after building your assets for production. |
Yeah, my f** stupidity |
So is your issue resolved now @lsdevelop? |
Nope, I'm start trying create new laravel project with broadcasting to validate my migrated files (10 with laravel websockets to 11 with reverb) |
It sounds to me like this is an issue with Herd not supporting SSL for their Reverb service. Maybe this is also the cause of the Safari issue? Going to experiment more today. |
@lsdevelop I can say that I do not believe this is related to the upgrade. I did a diff check on a fresh project and made sure everything was setup the same as a new project. That said, when I upgraded, it did not add the broadcast config for Reverb....but this did not resolve my issue. Note: The upgrade/broadcast config issue was just resolved here - #84 @joedixon Can you share the Reverb start command you used for SSL? Did you just run |
@fylzero just |
@joedixon I just tried this and Reverb does not work this way. I'm a bit confused, in Herd when using the Reverb service, it provides the REVERB_APP_ID, REVERB_APP_KEY, and REVERB_APP_SECRET. When removing the Herd Reverb service and using Currently:
Also, I think about you meant I've opened a bug with Herd: beyondcode/herd-community#467 |
After update broadcast.php, the connection has return this, i`m continue trying. |
I'm not sure it's a bug with Herd, it's just not supported on the built-in service yet. The app key, id and secret can be anything, but if you remove them all from your .env and run |
@joedixon Apologies. I'm not sure I understand the difference between Herd's Reverb service and the built-in service. Can you clarify that? Also, that's great those can be anything. Then do you have any thoughts as to why this isn't working for me with the reverb:start command? Thanks! |
Herd's service is completely separate from your application. It's essentially a standalone Laravel application running Reverb which any of your own applications can connect to. It's really for use in scenarios where you want to use Reverb, but not have it running alongside your application. What's the error you're seeing when trying to start the server with |
@joedixon Ok, so - using the Herd Reverb service without SSL, everything with Reverb works. If I...
I get the error: ...and the websocket event does nothing. No other errors. |
What is displayed in the console after running the reverb:start command? |
INFO Starting secure server on 0.0.0.0:8080 (myapp.test). |
Can you use the --debug option when starting the command to see if any connection events are being sent to the server? |
@joedixon Did --debug, tried executing a Reverb event again. Nothing more is outputting there - and as I mentioned, the browser console shows connection failed. I do see (after a second or two): |
Ok, if you hit https://myapp.test:8080/app/laravel-herd in the browser, do you get an SSL error or a server error? |
@joedixon Says "Internal server error" |
Can you share all of your |
|
Just tested with the exact same configuration and can't replicate it! Is this a brand new app or existing? If existing, can you send over how Echo is being instantiated? Can you also let me know the browser and send a screenshot of the error and anything relevant in the console? |
@joedixon Existing/upgraded app. Testing in Brave (shields off - basically Chrome). I'm not seeing any errors that haven't been shared already. I put the Echo code directly in my app.js: // Echo
import Echo from 'laravel-echo'
import Pusher from 'pusher-js'
window.Pusher = Pusher
window.Echo = new Echo({
broadcaster: 'reverb',
key: import.meta.env.VITE_REVERB_APP_KEY,
wsHost: import.meta.env.VITE_REVERB_HOST,
wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,
wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,
forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
enabledTransports: ['ws', 'wss'],
}) My vue code: onMounted(() => {
Echo.private(`branch.${page.props.authUser.branch_id}`).listen('IssueCreatedEvent', (event) => {
router.reload({ only: ['issues'] })
})
})
onUnmounted(() => {
Echo.leave(`branch.${page.props.authUser.branch_id}`)
}) I mean this all works without SSL - so I don't think anything is misconfigured. If youre open to it, we can jump on a Google Meet or something to walk through this. My email is just my github username at gmail dot com. I just had ankle surgery so I'm laid up with a laptop and nothing to do. Really appreciate your help here! |
Really, non secure working fine, tomorrow i deploy to my staging environment with reverb and ssl to starting tests in similarly production environment |
@fylzero can you try a brand new project just so we can rule out anything specific to the project / host? |
@joedixon Will do. ...but I've already diff checked to make sure nothing was missing compared to a fresh project. Also, the fact that it works sans-SSL should I think rule that out as an issue. |
Update, in production, works fine with SSL, the problem is local and specify from herd/valet. |
Hi @joedixon! sail artisan reverb:start --debug:
.env:
echo.js: import Echo from 'laravel-echo';
import Pusher from 'pusher-js';
window.Pusher = Pusher;
window.Echo = new Echo({
broadcaster: 'reverb',
key: import.meta.env.VITE_REVERB_APP_KEY,
wsHost: import.meta.env.VITE_REVERB_HOST,
wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,
wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,
forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
enabledTransports: ['ws', 'wss'],
}); I use WSL and Laravel Sail. The server is started using the command |
I have exactly the same problem Web server: Lightspeed error :
|
I also encountered this using Laravel Sail (Windows, WSL, Laravel 10 upgraded to 11). By adding port 8080 (used by Reverb) to docker-compose.yml solved the problem. |
@pilutiful |
Closing this now as we have a few different problems merged into the same issue. If you are still running into a problem, please open a new issue. |
cluster: 'Redis', Add this line in your Echo options |
Also ran into this one today 😅 Basically, the Or, in other words, regardless of what you're instructing Reverb/Pusher to do, it's going to demand a "secure" websocket connection, as visible in your browser by the fact that it'll try to connect to To fix this, there's two things you can do:
(If you're running Reverb inside Herd, and as long as those flags are missing, don't forget to turn off that service first, or you'll run into errors regarding the port already being in use!) |
hola, lo resolví de la siguiente forma: agregué la IP en la variable: REVERB_HOST="192.168.1.88" y reconstruí con npm un build para que tome los cambios. Funcionó perfecto!!! incluso lo probé de otros equipos conectados a la misma red de manera exitosa. Saludos desde Viña del Mar, Chile |
No, getting error: Local is working, but in production , the error persists and connection can not be established |
well I faced this problem as well and this helped me, consider taking a look here |
Reverb Version
1.0@beta
Laravel Version
v11.0.5
PHP Version
8.3
Description
I tried with the Postman and is connected well and returns the data and socket ID but javascript does not work I don't know where the issue
env file
echo.js
Steps To Reproduce
...
The text was updated successfully, but these errors were encountered: