fix websocket packets encapsulation for packets larger than 64kb