Instead of cramming ecoded json into the data channels, like you'd with websockets, you can build binary buffers with all the data that has to be communicated between server and client. For example movement commands like up/down/left/right alongside some flags like isJumping can be packed into a singe uInt8
actually binary websockets won't do in this case since the underlying protocol is still TCP with automatic retransmission mechanism which kills performance for very fast-paced games. You have to use WebRTC in that case