kerryjiang / SuperWebSocket

SuperWebSocket is a .NET implementation of WebSocket server.
Apache License 2.0
504 stars 194 forks source link

Switching to binary mode #7

Open KBeoughter opened 10 years ago

KBeoughter commented 10 years ago

When I open a SuperWebSocket client connection how do I switch from text to binary mode. With .Net WebSockets all I have to do is...

WebSocket.Options.SetRequestHeader("MessageType", "binary");

How do I do this with SuperWebSockets?

Note: The WebSocket server application I am talking to is not based on SuperWebSockets. It is located in another device and uses a version of the Mongoose WebSocket server.

KBeoughter commented 10 years ago

Kerry,

Turns out MessageType is something Mongoose uses to set the binary bit in a websocket header.

I figured out how to send "custom headers" using one of your alternate WebSocket constructors so Mongoose is now happy and sending the binary messages as I expected.

Ken