react-signalr icon indicating copy to clipboard operation
react-signalr copied to clipboard

feat: add hubProtocol support to SignalR

Open bgcurbani opened this issue 4 months ago • 3 comments

Hello, I was in the middle of an implementation in my application using your library and realized I needed to use a protocol in SignalR called MessagePackProtocol. However, there was no way to change the default protocol through the library.

I made the changes in the PR to enable parameterization of this behavior.

Unfortunately, I needed to commit the change in the Socket.io section; otherwise, I couldn't commit. The Husky hook was preventing it due to compilation failure.

bgcurbani avatar Sep 13 '25 21:09 bgcurbani

i like the same feature +1

ahmedrabii avatar Oct 29 '25 11:10 ahmedrabii

it look good for me, we like to have same interface for all socket tools, is it possible for socket-io or websocket?

hosseinmd avatar Oct 29 '25 11:10 hosseinmd

  • socket-io doesn’t have native MessagePack but you can use parser from socket.io-msgpack-parser to encode and decode messages
  • Plain WebSocket doesn’t have any enforced serialization format but you handle encoding/decoding manually
  • SignalR already supports MessagePack out of the box so it would be wise if the library could manage it

ahmedrabii avatar Oct 29 '25 12:10 ahmedrabii