Optimize encoding of websocket frames by merge if possible
Merge remote-tracking branch: upstream/master