Mr.Wang from Next Door
Mr.Wang from Next Door

Reputation: 14790

Customize SignalR to handle raw messages

I tried the SignalR(Self-Host) and seems it wraps the message with its own payload in JSON. Is it able to handle SignalR raw message?

  1. I wanna set the WebSocket sub-protocol to "wamp"
  2. I need send & receive the message in raw format as it is on client side
  3. I don't need any fallback support, only WebSocket and I wanna turn off all the other fallback features

Br

Upvotes: 0

Views: 815

Answers (1)

vtortola
vtortola

Reputation: 35905

As far as I know, SignalR does not support WebSocket sub-protocols, It can handle strings if you use the PersistentConnection API, that contains a method to receive String :

Task OnReceived(IRequest request, string connectionId, string data);

If you need WebSockets with a custom protocol, you can use XSocket.NET : https://github.com/XSockets

Upvotes: 2

Related Questions