pusher / pusher-websocket-swift

Pusher Channels websocket library for Swift
https://pusher.com/channels
MIT License
273 stars 166 forks source link

Pusher ping/pong message #429

Closed rockyftn closed 5 months ago

rockyftn commented 5 months ago

I read this documentation https://pusher.com/docs/channels/library_auth_reference/pusher-websockets-protocol/#ping-and-pong-messages and in the section I see this text:

In protocol versions 5 and above, when using an old version of the WebSocket protocol, Pusher Channels will send pusher:ping event (see events) to the client). The client should respond with a pusher:pong event.

In PusherSwift class PROTOCOL is set to 7, but in PusherConnection method sendPing WebSocket PING package.

Can I get some help from you? Thanks

benw-pusher commented 5 months ago

I am not certain I understand what issue you are reporting here - could you elaborate? Is the issue that you expect the client not to send a ping event? The doc you linked to shows that this is expected:

This means that Pusher Channels will respond to a WebSocket protocol ping message with a pong message, and also it will respond to a pusher:ping event with a pusher:pong event (both have empty data).

rockyftn commented 5 months ago

We found an issue on our server side (we use Soketi lib for Laravel PHP), that library not responding to a WebSocket protocol ping message. That library expects to send a ping message as {event: "ping", data: []} but this Pusher library doesn't support that ping format.