Did you look at
the WebSocket protocol (RFC)? A quick read of the opening handshake indicates that you're going to have to reply with a 101 status code and a Sec-WebSocket-Accept header; see the RFC for how to get the value for that header.
Quote:
Originally Posted by Example Response Headers, RFC 6455
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
|
Once you've completed the handshake you can worry about sending data.
I don't know why you're using WebSockets for this anyway. You shouldn't need to talk from a browser -> the Graal server directly, so do it via some serverside language with regular old sockets.