When using the Raw WebSocket option available in SockJS, our Vert.x implementation returns a binary websocket frame instead of a text websocket frame.
The following is used to specify that the raw WebSocket transport should be used:
var sockjs = new WebSocket('ws://localhost:7777/simplepush/websocket');
We use the following to write to the socket:
sock.write(new Buffer(toJson(helloResponse)));
sock in this case is an instance org.vertx.java.core.sockjs.impl.RawWebSocketTransport, and has only a single write method that takes a Buffer instance. RawWebSocketTransport has a ServerWebSocket that it uses to write the Buffer:
public SockJSSocket write(Buffer data) {
ws.write(data);
returnthis;
}
The above ws.write call will end up in DefaultServerWebSocket.write:
@Override
public ServerWebSocket write(Buffer data) {
writeBinaryFrame(data);
returnthis;
}
This will write a binary WebSocket frame.
We need to investigate if there is some way to specify that the default should be to use text WebSocket frames instead.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira