-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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: Ping and Pong #15430
Labels
ext/websocket
related to the ext/websocket crate
suggestion
suggestions for new features (yet to be agreed)
Comments
Closed due to radio silence on this issue. |
Seems desirable. Reopening. |
littledivy
added
suggestion
suggestions for new features (yet to be agreed)
ext/websocket
related to the ext/websocket crate
labels
Sep 3, 2022
Spec issue: whatwg/websockets#10 |
I discovered that ping/pong frames are sent automatically thanks to: #13172 But I had to set |
I am going to close this as we automatically ping-pong now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ext/websocket
related to the ext/websocket crate
suggestion
suggestions for new features (yet to be agreed)
Hi, Would it be possible to include the methods
.ping()
and.pong()
on Deno's Web Socket implementation? It's noted that while browsers do not support sending these control frames, they can be a server side requirement if deploying WebSocket servers behind load balanced environments.Infrastructure such as AWS's Application / Network Load Balancer (as well as many other load balancers) will automatically terminate idle connections. Applications can mitigate LB termination by periodically sending
ping()
control frames down to each connected client. Becauseping
frames are sent out of band from the sockets messaging channel, server applications can keep their connection keep alive logic and application protocol logic separate (with the added benefit of browser Web Sockets not seeingping
control frames at all)Without this functionality, it does raise quite a few challenges porting existing application protocols to run on Deno. This is due to applications often omitting ping control frames in the applications protocol itself (as it's generally understood that these control frames are already provided as part of the RFC6455 specification)
RFC
https://www.rfc-editor.org/rfc/rfc6455#section-5.5.2
https://www.rfc-editor.org/rfc/rfc6455#section-5.5.3
Rust
https://docs.rs/ws/latest/ws/struct.Frame.html#method.ping
https://docs.rs/ws/latest/ws/struct.Frame.html#method.pong
Node
https://github.com/websockets/ws/blob/master/lib/sender.js#L209
https://github.com/websockets/ws/blob/master/lib/sender.js#L252
Would it be possible to include these methods?
The text was updated successfully, but these errors were encountered: