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

Added a quiet mode #86

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Added a quiet mode #86

wants to merge 3 commits into from

Conversation

nebloc
Copy link

@nebloc nebloc commented Dec 11, 2018

I was testing a service that pinged a lot, and would interrupt typing, so I added a flag -q, --quiet that would silence the ping control frame (pong and close control frames handled same as usual) from the console.

May be useful for others 🤷‍♂️ 😄

incoming pings will be silenced from console if option --quiet is used
Added examples on how to use the --slash and --quiet flags and what they
will do.
@lpinca
Copy link
Member

lpinca commented Dec 12, 2018

Thank you for the PR. Some thoughts:

  • I think --quiet is not a good name for the option. It's too general when in reality it only prevents ping messages from being printed.
  • A server or client could spam pong frames for no particular reason so I think the option should also silence the pong messages or we need two separate options, one for pings and one for pongs.
  • Doesn't this also happen with data messages? If the other peer sends a lot messages while the user is typing, doesn't it cause the same problem?

@nebloc
Copy link
Author

nebloc commented Dec 12, 2018

  • Agreed about wording, but also didn't want it to be too long (i.e .--silence-incoming-pings) any suggestions? 😅
  • A server could spam pongs, but I was under the impression that the tool was geared towards debugging and so if it is spamming pongs when you aren't pinging then it is a bug... would you ever want to silence it?

At the same time wouldn't hurt to have, but should not be under the same flag. I am testing a service that will ping often and I don't need to know, just pong back, but when I ping I want to ensure it pongs me.

  • Unsure, I have not tested with incoming messages; probably would but unsure how to handle... before ping store what is being written and write it back out in the correct order after?...

@lpinca
Copy link
Member

lpinca commented Dec 12, 2018

My point is, if this happens with everything that is written (data messages, pings, pongs) why this only take into account pings? Not sure if it's possible or how hard it will be but isn't it better to try to solve the issue differently? Ideally what is written should not mess up user input.

@jonbo372
Copy link

Perhaps a slightly different view of the same problem. To me, ping/pongs are part of the underlying protocol. In the same way I don't see the HTTP upgrade request, I don't want to see the websocket control frames in normal operation. Based on that, perhaps another option for verbose control frames? By default, no control frames are printed but --verbose-control-frames would enable it. This would then include all control frames, which currently there are only three defined (as far as I know). Close, Ping & Pong.

Does that make sense?

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

Successfully merging this pull request may close these issues.

3 participants