-
Notifications
You must be signed in to change notification settings - Fork 510
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
feature: add an option to send bytes with ws #1828
base: main
Are you sure you want to change the base?
feature: add an option to send bytes with ws #1828
Conversation
I uploaded it without automatic tests. Just tested it myself. We use it in my work to test out web sockets. I would be glad to get some help with tests. |
|
||
const get_bytes_payload = (payload) => { | ||
if (typeof payload === 'string') { | ||
let utf8Encode = new TextEncoder() |
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.
Is there a particular reason to use TextEncoder
here? is that a common way to encode binary data for WebSockets?
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.
Actually not. It was just a way that I found to turn string into bytes with js. I wanted that there will be an option to send string as bytes as well.
thank you @YoniGang! adding a test should be fairly straightforward, I'll try to put a quick one together today that we can iterate on if needed. |
Hii @hassy! Oo you have any update? |
Any update here? I'm hoping to be able to send (and receive/discard) binary payloads over websockets with Artillery |
Add an option to send bytes through web sockets.
Including an example of a function that sends stream and example of how to send bytes with a string without a function
Issue ref: #1780