Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inspector proxy: Add ping/pong keepalive/heartbeat to debugger connec…
…tion (facebook#44086) Summary: When a debugger frontend is connected to inspector-proxy via another proxy or tunnel that times out on idle (such as [VS Code's remote tunnel](https://github.com/microsoft/vscode/blob/main/src/vs/platform/tunnel/node/tunnelService.ts)), the connection between proxy and debugger may be dropped. In addition, when the connection is dropped without a closing handshake, the proxy does *not* detect the disconnection - no disconnect is logged to the reporter and no notifications are sent to any connected devices. This adds a mechanism using the WebSocket-standard `ping` and `pong` frames to: 1. Keep the connection alive 2. Detect when the debugger has gone away Note that as all WebSocket clients already **must** reply to a ping with a pong, this is non-breaking for compliant implementations: https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2 Changelog: [General][Added] Inspector proxy: Add ping/pong keepalive to debugger connections. Reviewed By: hoxyq Differential Revision: D56069185
- Loading branch information