port from 3.x: fix WebSocket cannot send/receive more than 4096 bytes of...

... data