Thanks Stuart. I need to avoid annotations since this will be configured dynamically. I was wrong about the version, right now i'm on 2.0.9.Final. I'm trying to create a websocket proxy. I was able to get the ReceiveListener registered in Undertow and create a WebSocketClient. I'm trying to pipe the data from the client through Undertow to the server, starting with a Text message:
@Override
protected void onText(WebSocketChannel webSocketChannel, StreamSourceFrameChannel messageChannel)
throws IOException {
PooledByteBuffer b = pool.allocate();
ByteBuffer buffer = b.getBuffer();
while (messageChannel.read(buffer) > 0) {
WebSockets.sendText(buffer, wsClient, null);
}
b.close();
}
The message sent to the downstream websocket server isn't right though (and the server rejects it). The frame from wireshark just shows a buffer of "\000\000...". I think I'm close but I don't see an example of how to do this. Any suggestions or pointers would be greatly appreciated.
Thanks
Marc Boorshtein