Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket transportMode is missing heartbeat #2403

Closed
1 of 2 tasks
ianschmitz opened this issue Jan 27, 2020 · 4 comments
Closed
1 of 2 tasks

WebSocket transportMode is missing heartbeat #2403

ianschmitz opened this issue Jan 27, 2020 · 4 comments

Comments

@ianschmitz
Copy link

ianschmitz commented Jan 27, 2020

  • Operating System:
  • Node Version: 10.18.1
  • NPM Version: 6.13.4
  • webpack Version: 4.41.5
  • webpack-dev-server Version: 3.9.0
  • Browser: Chrome 79
  • This is a bug
  • This is a modification request

Expected Behavior

webpack-dev-server sends keep alive heartbeat when using transportMode: 'ws', consistent with sockjs-node to keep the connection open while developing.

Actual Behavior

WebSocket connection times out after a period of inactivity. A page refresh is needed to reconnect.

Create React App related issue: facebook/create-react-app#8091

For Bugs; How can we reproduce the behavior?

Use transportMode: 'ws', connect to running webpack-dev-server instance, and wait for socket to timeout.

Here's the RFC for ping/pong in the WebSocket spec: https://tools.ietf.org/html/rfc6455#section-5.5.2

@alexander-akait
Copy link
Member

/cc @Loonride

@alexander-akait
Copy link
Member

Easy to implement - https://github.com/websockets/ws#how-to-detect-and-close-broken-connections, somebody want to be a champion?

@knagaitsev
Copy link
Collaborator

Easy to implement - https://github.com/websockets/ws#how-to-detect-and-close-broken-connections, somebody want to be a champion?

I can do this

@alexander-akait
Copy link
Member

Client doesn't require additional code (browser automatically sends ping)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants