tracker issue : CF-4203142

select a category, or use search below
(searches all categories and all time range)
Title:

WebSocket implementation does not support ping/pong (keepalives)

| View in Tracker

Status/Resolution/Reason: To Fix//BugVerified

Reporter/Name(from Bugbase): Mosh Teitelbaum / ()

Created: 07/24/2018

Components: Web Socket

Versions: 2016,2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2016.0.06.308055 /

Priority/Frequency: Minor / All users will encounter

Locale/System: English / Win 2016

Vote Count: 0

Problem Description:

The WebSocket protocol defines the concept of "ping-pongs" which are small control frames sent from server to client (the "ping") and back (the "pong") as a sort of keepalive.  Without these keepalive frames, some web browsers (specifically modern implementations of Firefox) may consider the WebSocket connection closed if too much time passes without any traffic over the connection.

Note, this happens whether or not the WebSocket Proxy is being used.

See https://tools.ietf.org/html/rfc6455#section-5.5.2 for details of the ping-pong part of the protocol.

Steps to Reproduce:

Create a WebSocket handler and a WebSocket client, open a WebSocket connection and wait.  In Firefox, 10 minutes and 11 seconds after opening the connection, if there's no additional traffic, Firefox will throw an exception assuming the connection is closed and will force a disconnect.  ColdFusion remains unaware of the disconnection.

Actual Result:

The WebSocket connection is disconnected.

Expected Result:

The WebSocket connection remains connected.

Any Workarounds:

I've managed to get around this problem by creating a scheduled task to run every few minutes (I have it at 2) to send a server message to all open connections.  This forces traffic over the connection so that it never times out.  However, it is absolutely a hack with much more overhead involved than if ping-pongs were implemented directly in CF.

Attachments:

Comments:

Hi. I'd like to suggest that this should have a higher priority than "minor." While Chrome seems to handle the lack of ping/pongs reasonably well, Firefox goes absolutely nuts and eventually kills the connection in a way that ColdFusion is unaware of the closure. This could lead to some serious problems especially in applications that are heavily dependent on WebSockets.
Comment by Mosh T.
29405 | July 26, 2018 06:44:23 PM GMT