-
Notifications
You must be signed in to change notification settings - Fork 90
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
Potential Issue with Pusher Ping/Pong Messages #224
Comments
So websocket ping/pong is handled here: reverb/src/Servers/Reverb/Connection.php Line 84 in 8383876
Maybe this should call |
I agree with above approach, probably receiving any control frame should Lastly, while playing around to check this, I found that reverb/src/Servers/Reverb/Console/Commands/StartServer.php Lines 91 to 97 in 8383876
|
I don't think calling I'll take a look to see what's involved in adding support for this. I notice there are some other similar issues on the repo so wonder if this should be addressed by the client. Doesn't look, at first glance, that there are any checks for the advertised supported pusher protocols. |
Yes but by calling What do you think? |
I believe that because the dotnet WebSocket client supports protocol level pings they didn't bother to include support for |
We're seeing the same issue using the https://github.com/pusher/pusher-websocket-swift package where (unlike the Echo / Pusher JS client), it is not sending |
Appears most non web based clients don't use |
Is anyone on this thread affected by the issue able to give #253 a try to see if it resolves the issue? |
Thanks @joedixon. I can give this a go in our Flutter mobile app in the next couple of weeks. Our workaround was just to send a client message on the connection as that keeps it alive but using internal events would be great. |
@joedixon Tested the Before this change (and without sending a client message):
Debug logs:
With this change:
Debug logs:
Appreciate the fix 🙏 |
Thanks @davidrushton. I'll address those Did you manage to get the server sending out a |
@joedixon Sorry for the delay. We just use the Flutter package defaults but let me know if you want us to test anything specific here. |
I can confirm the same with .NET Framework websocket client. |
Reverb Version
1.0.0-beta14
Laravel Version
10.10
PHP Version
8.1
Description
If I am understanding the Pusher protocol correctly, then if the WebSocket implementation supports native ping/pong messages, then Pusher will use those, and the
pusher:ping
andpusher:pong
messages are only used if the client doesn't support websocket protocol ping messages.Link to Pusher docs here
It seems like Laravel Reverb is ONLY sending
pusher:ping
and not using the websocket native ping messages to determine if a connection is still alive. I found this to be a compatibility issue with the official dotnet Pusher client. If I understand the situation correctly, because the C# implementation of the websocket client handles ping messages at the ws protocol level, they didn't implement any handlers forpusher:ping
messages, which makes this client incompatible with Reverb.If my assumptions are correct then this means Reverb should detect the client version and use a different pinging strategy based on the version? Or in my case could I just disable the reverb ping messages entirely and rely on the websocket pings being handled internally to keep the connection alive?
Edit: This excerpt from the Pusher docs linked above seems to imply that the C# client's behaviour is fine:
It doesn't explicitly state that clients that already support protocol level pings must ALSO respond to pusher:ping events.
Steps To Reproduce
Set up a minimal Reverb server and minimal Pusher dotnet client (https://github.com/pusher/pusher-websocket-dotnet), wait 1 minute after connection, server drops client connection due to missed ping and client reconnects.
The text was updated successfully, but these errors were encountered: