title: Is there a way to limit the maximum size of a websocket message?
body: <p>I have an application in which I wish to limit the maximum size of a message that was sent across the wire by a connected client. Since the theoretical <a href="https://stackoverflow.com/a/24154610/1254837">maximum of a message in Node.js is about 1.9&nbsp;GB</a>, I actually never want my application to allocate that big a chunk of memory if some malicious clients tries to send an over-sized packet.</p>
  
  <p>How can I limit the <strong>incoming</strong> message size, to say, 1024 bytes?</p>