antoniodipinto / ikisocket

🧬 WebSocket wrapper with event management for Fiber https://github.com/gofiber/fiber. Based on Fiber WebSocket and inspired by Socket.io
MIT License
123 stars 21 forks source link

Not receiving binary data #20

Closed jibon57 closed 2 years ago

jibon57 commented 2 years ago

Describe the bug Output is auto encoded to string. It is fine if I send data to server but if send data using EmitTo to client then format breaks. It's convert into text.

To Reproduce Steps to reproduce the behavior: Try with protocol-buffers to send encoded data from server to client (js). It works fine if encoded with json but not default protocol-buffers encoding.

Expected behavior Should be able to both sending & receiving binary data

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

jibon57 commented 2 years ago

Looks like you've set text type as default: https://github.com/antoniodipinto/ikisocket/blob/e8049cc9e56b2cbe531eeb79adc6ace38b668beb/ikisocket.go#L410 Better to give option during emit to use binary as well as