philippseith / signalr

SignalR server and client in go
MIT License
140 stars 40 forks source link

Sending binary data without transforming to base64? #155

Closed princefishthrower closed 1 year ago

princefishthrower commented 1 year ago

Hi, thanks a lot for this awesome library!

I'm trying to send binary data (from an mp3) over SignalR, and finally realized after some troubleshooting that SignalR is transforming it to base64 behind the scenes. This is fine, but I'm wondering if there would be a performance advantage in sending the binary data as-is directly to the clients.

Is there an option I can pass to tell SignalR I want to send binary data and not convert it to a base64?

Thanks!

philippseith commented 1 year ago

SignalR supports JSON and MessagePack encoding. The latter is a binary encoding. This should suit your needs.