-
Notifications
You must be signed in to change notification settings - Fork 211
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
Support for binary response / hex output: #145
Comments
p.s. buf2hex output may then be used like this: wscat -c ws://1.2.3.4/api/something -w 0 | xxd -p -r | protoc --decode_raw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Before “ws.send(programOptions.execute);” add:
ws.binaryType = "arraybuffer";
For hex output use:
wsConsole.print(Console.Types.Incoming, buf2hex(data), Console.Colors.Blue);
p.s.
function buf2hex(buffer) { // buffer is an ArrayBuffer
return [...new Uint8Array(buffer)]
.map(x => x.toString(16).padStart(2, '0'))
.join('');
}
The text was updated successfully, but these errors were encountered: