Code: Select all
private byte[] makeFrame(String message) throws IOException {
byte[] bytes = message.getBytes(Charset.forName("UTF-8"));
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
byteStream.write(0x81);
byteStream.write(bytes.length);
byteStream.write(bytes);
byteStream.flush();
byteStream.close();
byte[] data = byteStream.toByteArray();
}
Code: Select all
Websocket connection to 'ws://localhost:8080/' failed: Invalid frame header
Vielen Dank, Ben
Mobile version