Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Support WebSocket Ping/Pong #765

Closed
Closed
@zek

Description

@zek

Bug Explanation

I was testing websockets on an iOS application and noticed after 2 minutes events stopped cuz connection is marked as idle and removed due to lastPongedAt

However ping sent from iOS client and it receives pong response successfully. However it doesn't send pusher:ping instead it send ping message in TCP layer.

So ping messages were captured by Ratchet WsServer while laravel-websockets expects ping message differently.

image

Solution

I override onControlFrame as following and it works like a charm.

image

image

If you check https://pusher.com/docs/channels/library_auth_reference/pusher-websockets-protocol#ping-and-pong-messages they mention

In protocol versions 5 and above, when using an old version of the WebSocket protocol, Pusher Channels will send pusher:ping event

So it could be nice if we can support this functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions