stomp-js / stomp-websocket

Stomp client for Web browsers and node.js apps
https://stomp-js.github.io/stomp-websocket/
Apache License 2.0
141 stars 36 forks source link

Support for protobuf #9

Closed pantonis closed 5 years ago

pantonis commented 7 years ago

As web is evolving protobuf is being used more and more due to its serialization speed and the small payload size compared to JSON.

Can you develop support for protobuf?

kum-deepak commented 7 years ago

This will indeed be a good feature. Unfortunately I will not be able to take it up right now. If you are able to get it working please raise a PR. Many thanks!

pantonis commented 7 years ago

kum-deepak can you give me your skype or email?

kum-deepak commented 7 years ago

Not active on Skype. My email is deepak@kreatio.com

kum-deepak commented 6 years ago

Planning for next version of stompjs is on the way. Your participation will be really appreciated, please join at https://github.com/stomp-js/stompjs/issues/1

Support for binary payloads (needed to fix this) will get attempted 😄

pantonis commented 6 years ago

@kum-deepak any news on this one? wish I had the knowledge to help

kum-deepak commented 6 years ago

The work is actually more involved than it sounds. The current parser relies on strings - as it uses Javascript Regular expressions. The binary bodies are likely to get messed up while converting to String. Also the current parser fails if the body has NULL octate.

The solution I have been thinking is to write a parser that works directly on octates and converts only specific parts to strings (command and headers).

I have been working on this parser - please check https://github.com/stomp-js/stompjs/pull/6

pantonis commented 6 years ago

I will check it in weekend as I am overloaded right now !

Thanks

kum-deepak commented 6 years ago

Changes have been merged into master. I have tested round trip of binary payload. https://github.com/stomp-js/stompjs/blob/master/spec/unit/compatibility/message.spec.js#L28

kum-deepak commented 5 years ago

Added in v5.0.0. Please upgrade https://stomp-js.github.io/stompjs/additional-documentation/upgrading.html