private static final class EchoStreamInbound extends StreamInbound {
@Override
protected void onBinaryData(InputStream is) throws IOException {
// Simply echo the data to back to the client.
WsOutbound outbound = getWsOutbound();
int i = is.read();
while (i != -1) {
outbound.writeBinaryData(i);
i = is.read();
}
outbound.flush();
}