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

Merge in "verbose" mode #31

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

Conversation

nwwells
Copy link
Collaborator

@nwwells nwwells commented Jan 24, 2017

@truhlikfredy, what do you think about adding a command-line flag for verbosity?

@truhlikfredy
Copy link

Yes that would be better, because now does only hardcoded console.log()

@3rd-Eden
Copy link
Member

This PR also contains renaming of package, bin and what not. Ideally verbose mode should be locked behind a -v CLI option.

@nwwells
Copy link
Collaborator Author

nwwells commented Jan 25, 2017

Right, @3rd-Eden. I was just about to ask, @truhlikfredy, would you be willing to add the flag and remove all the other changes?

@truhlikfredy
Copy link

I didn't initiated the PR (i think my fork is not good enough in this stage for merge). The changes made there are very crude and dirty. Renamed the package so it will not overwrite the original when original behavior is needed.

@lpinca
Copy link
Member

lpinca commented Jan 26, 2017

I'm -1 on these changes. I think there is no real value in printing the flag objects.
I would like to see them removed from ws completely but that's another issue.

@nwwells
Copy link
Collaborator Author

nwwells commented Jan 26, 2017

This brings up an interesting question, though: What is the expected behavior for binary data? netcat of course just passes it through, but the ws protocol provides the concept of frames, which are converted into \ns by wscat. You could base64 encode binary data (or hex encode, as with #5), what do you guys think of that, @lpinca & @3rd-Eden?

@lpinca
Copy link
Member

lpinca commented Jan 26, 2017

I think that if the 'message' listener receives a buffer it makes sense to print it as hex.

wsConsole.print(`< ${buf.toString('hex')}`);

Something like this, beautified if necessary. It probably wasn't designed to deal with binary messages. What other tools do in this case?

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.

None yet

4 participants