MemeLabs / MemeLabs/Rustla2

correctly implement websocket PING/PONG

Open
#51 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

backend good first contribution
Dominant language
C++
Stars
46
Forks
24
PR merge metrics
No merged PRs in 30d

Description

The client has a hacked heartbeat implementation which sends empty text messages [1] to the server where they're unceremoniously dropped. [2] This is needed to make sure proxies don't drop the connection when the socket is inactive.

This implementation is redundant with the WebSocket spec's own heartbeat mechanism PING/PONG. [3] We can achieve achieve the same result by adding a broadcast timer to the server to emit PINGs and correctly implementing PING/PONG in our message handler.

This will allow the web service to dictate heartbeat interval based on the requirements of the hosting environment, enable omitting heartbeats for recently active clients, avoid filling the browser's WS frame inspector with garbage, and make the server more compliant with the WS spec.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/actions/websocket.js around the existing heartbeat and api/src/WSService.cpp around the server message handling. Trace the proposed broadcast timer and PING/PONG flow, then verify that inactive connections receive protocol heartbeats without empty text messages and that recently active clients can omit them.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.