-
-
Notifications
You must be signed in to change notification settings - Fork 563
allow user pass ping_data in connection #1660
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
You didn't explain why you're proposing this, making it hard for me to tell if it's the right solution. Technically, your code will break if |
The next step would be for me to understand what is the purpose of this feature and to decide whether I want to support it in the library. |
You may be proposing this because some servers require clients to send a ping with a specific content at a minimum frequency. However, most of those servers expect it in a Text frame, not a Ping frame. With the proposed Servers relying on protocol-level ping/pong in Ping/Pong frames, as opposed to application-level ping/pong in Text frames, usually don't care about the content of pings and pongs. websockets has been sending random 4-bytes payloads in pings for a decade without issues. |
Hi @aaugustin In some backend implement, server doesn't response the ping when the ping data is not a The ping data in The the protocal desgin itself provides ability to custom the ping data in |
Yeah, but random 4-bytes payloads not suite for all caces, we just need a way to allow user control the keep alive behaviour, maybe there's better proposal |
I guess "not a str type" means "not valid UTF-8"; this is a clear spec violation as explained here: #922 (comment); those servers are buggy and need to be fixed. Alternatively, you can disable pings with I'm not going to complexify the API because "some backend implement" is buggy. The API has a lot of parameters already; I'm not adding new ones without a very strong reason. If I wanted to make a change, I'd send a random ASCII string rather than random bytes. Until now, getting buggy servers to fix their bugs has worked for me :-) |
No description provided.