.. / socket.io
Star Fork

Realtime application framework (Node.JS server)

socket.io
socketio
...

Latest

<script> @src 🛡️ wh-host ⏱️ any
More information

Root Cause

Source: https://github.com/socketio/socket.io/blob/e95f6abf93766662cd3b341599ed312f4330213f/packages/socket.io/lib/client.ts#L137

this._packet({
  type: PacketType.CONNECT_ERROR,
  nsp: name,
  data: {
    message: "Invalid namespace",
  },
});

Source: https://github.com/socketio/socket.io/blob/e95f6abf93766662cd3b341599ed312f4330213f/packages/socket.io-parser/lib/index.ts#L101

private encodeAsString(obj: Packet) {
  // first is type
  let str = "" + obj.type;

  // attachments if we have them
  if (
    obj.type === PacketType.BINARY_EVENT ||
    obj.type === PacketType.BINARY_ACK
  ) {
    str += obj.attachments + "-";
  }

  // if we have a namespace other than `/`
  // we append it followed by a comma `,`
  if (obj.nsp && "/" !== obj.nsp) {
    str += obj.nsp + ",";
  }

  // immediately followed by the id
  if (null != obj.id) {
    str += obj.id;
  }

  // json data
  if (null != obj.data) {
    str += JSON.stringify(obj.data, this.replacer);
  }

  debug("encoded %j as %s", obj, str);
  return str;
}

Related links:

Found by @j0r1an.


Source | History