!7 p { serveHttpWithWebsockets(8888, new WebSocketFactory { protected void onPong(WebSocketFrame pongFrame) { print("pong"); } protected void onMessage(WebSocketFrame messageFrame) { print("msg"); } protected void onClose(CloseCode code, String reason, boolean initiatedByRemote) { print("close"); protected void onException(IOException e) { print("exception"); } }); } html { ret "HTML still works!" + hjavascript([[ var exampleSocket = new WebSocket("ws://localhost:8888/"); exampleSocket.send("Here is an important message!"); ]]); }