elpheria/rpc-websockets

Whether there is an interest in providing an extensible encoder and decoder?

Closed this issue · 5 comments

JSON is now used by default to decode and encode data, which is not easy to scale when you need to use other formats to encode and decode data in your application. For example, when using msgpack to binary encode the data transferred.

Thanks for this suggestion, @noneghost! This would make a great feature. Since this is a feature we don't personally use, it'd be great to have a PR for this!

Thanks for this suggestion, @noneghost! This would make a great feature. Since this is a feature we don't personally use, it'd be great to have a PR for this!

I've added a DataPack class to define the encoding and decoding logic, which can be passed in externally by the user. By default, DefaultDataPack is used. #150

I'm not very familiar with the npm build of nodejs and may have committed something wrong with the format. If you can, hopefully you can give some advice.

I'm not a native English speaker and may have some bias in the description.(google translate)

Thanks! The PR description disappeared, btw. I'll take a look at a PR soon. Would be great to have some desc, though!

Thanks! The PR description disappeared, btw. I'll take a look at a PR soon. Would be great to have some desc, though!

ok , I've updated PR description.

Resolved with #150.