-
Notifications
You must be signed in to change notification settings - Fork 51
fix: ping/pong upstream server #355
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
looks good IMO |
4e9fde9
to
6f51e27
Compare
6f51e27
to
c446a1b
Compare
@SozinM can I get a review on this when you have time -- thanks |
let mut interval = tokio::time::interval(options.ping_interval); | ||
loop { | ||
interval.tick().await; | ||
if let Err(e) = write.send(Message::Ping(bytes::Bytes::new())).await { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be random bytes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't really matter, it can be empty and won't matter. as long as a Ping is going, a Pong is expected. contents of ping is kind of useless imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it being empty should be ok. The mean reason to add data is to be able to track ping/pongs that are sent/arrive out of order.
Happy to add a couple of bytes of randomness if ya'll feel strongly about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, should be good
merging is as it's on;y websocket proxy changes |
Description
Add ping/pong for upstream connections (see #322). I'll add the equivalent for downstream clients in a separate PR