-
Notifications
You must be signed in to change notification settings - Fork 28
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
websocket-nats can't publish binary message(Uint8Array) #4
Comments
well,translate the buffer to string first,it works. message_str=String.fromCharCode.apply(null, buf); |
Glad you were able to find a workaround! This functionality is actually supported in node-nats using the However, I think it's a good idea to support |
It was a simple fix actually, you should be able to pass a |
thanks |
we want to publish protobuf.js encoded message,when publish the encoded Uint8Array message,the encoded frame is not correct.
nats_con=NATS.connect("ws://192.168.1.103:4223"); nats_con.publish("foo","hello string from websocket"); nats_con.subscribe("foo",function (msg) { console.log("msg:",msg) }); //the frame of the below publish is error nats_con.publish("foo",new Uint8Array(16) ); console.log("script has exec finished");
The text was updated successfully, but these errors were encountered: