drashland / wocket

A WebSocket library for Deno
MIT License
104 stars 4 forks source link

support handling any messages #135

Closed ebebbington closed 2 years ago

ebebbington commented 2 years ago
handlemessage(msg => {
  ...
  const evt = new customevent({
    detail {
      id: ...,
      data: msg

string json binary

ebebbington commented 2 years ago

we wont be able to support binary, because the way we need to stringify and parse the message(s), leaving the typed array a client sends, becoming an object when the server parses it

Whilst a user could try convert it, it's a pain in the arse. Sending binary over the wire is a good call, but if someone wants to do that, i'd suggest using a native ws server and client