{
  "id": "task_libraries:websocket/javascript",
  "path": "/exapedia/javascript-websocket-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "JavaScript WebSocket libraries",
  "answer": [
    {
      "t": "text",
      "text": "JavaScript WebSocket libraries keep one connection open between a server and its clients, and either side can send a message over it at any time. These libraries let chat apps, live dashboards, and AI agents push updates to clients as they happen, without the client polling the server."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "JavaScript WebSocket libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#ws",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F127"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F128"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F129"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#faye-websocket",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F142"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F143"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#websocket-driver",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F159"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#crossws",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F176"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#socket-io",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F193"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#engine-io",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F208"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sockjs-node",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F225"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F229"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#graphql-ws",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F240"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F241"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "npm"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#ws",
          "label": [
            {
              "t": "fact",
              "fact": "F127"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F128"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Binary application payloads",
            "HTTP long-polling transport"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#ws",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F127"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F136"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#faye-websocket",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F142"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#websocket-driver",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F159"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#crossws",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F176"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#socket-io",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F193"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#engine-io",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F208"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sockjs-node",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F225"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#graphql-ws",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F240"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F251"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "ws",
          "name": [
            {
              "t": "fact",
              "fact": "F127"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/websockets/ws"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/ws"
            },
            {
              "label": "Docs",
              "href": "https://api.github.com/repos/websockets/ws/contents/doc/ws.md"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "ws implements WebSocket clients and servers for Node.js and passes the Autobahn protocol test suite. A "
            },
            {
              "t": "code",
              "text": "WebSocketServer"
            },
            {
              "t": "text",
              "text": " listens on its own port or shares an existing HTTP server, and each connection emits a "
            },
            {
              "t": "code",
              "text": "message"
            },
            {
              "t": "text",
              "text": " event and sends with "
            },
            {
              "t": "code",
              "text": "send"
            },
            {
              "t": "text",
              "text": ", for text or binary data. The library runs only in Node.js: in the browser, the built-in "
            },
            {
              "t": "code",
              "text": "WebSocket"
            },
            {
              "t": "text",
              "text": " object connects to a ws server directly. Compression through the permessage-deflate extension is off by default on the server, because it costs speed and memory."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F128"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F129"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/websockets/ws/contents/doc/ws.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F127"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F12"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/prisma/prisma-examples",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F140"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "async function start() {\n  /** Create WS Server */\n  const wsServer = new WebSocketServer({\n    server: httpServer,\n    path: '/graphql',\n  })\n\n  /** hand-in created schema and have the WS Server start listening */\n  const serverCleanup = useServer({ schema, context }, wsServer)\n\n  const server = new ApolloServer<Context>({\n    schema,\n    plugins: [\n      ApolloServerPluginDrainHttpServer({ httpServer }),\n      {\n        async serverWillStart() {\n          return {\n            async drainServer() {\n              await serverCleanup.dispose()\n            },\n          }\n        },\n      },\n    ],\n  })\n\n  await server.start()\n  app.use('/graphql', cors<cors.CorsRequest>(), express.json(), expressMiddleware(server, { context: async () => context }));\n\n  httpServer.listen(PORT, () => {\n    console.log(`🚀 Server ready at http://localhost:${PORT}/graphql`)\n    console.log(`⏰ Subscriptions ready at http://localhost:${PORT}/graphql`)\n    console.log(\n      `⭐️ See sample queries: http://pris.ly/e/ts/graphql-subscriptions#using-the-graphql-api`,\n    )\n  })\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/prisma/prisma-examples/blob/45d6bf6193c66bc869240df90c75b2e4b45d008f/orm/graphql-subscriptions/src/server.ts",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F139"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20ws%20for%20WebSocket%20communication&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F127"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { WebSocketServer } from \"ws\";\nconst server = new WebSocketServer({ port: 8080 });\nserver.on(\"connection\", (socket) => socket.send(\"Hello\"));\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/ws/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F132"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "faye-websocket",
          "name": [
            {
              "t": "fact",
              "fact": "F142"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/faye/faye-websocket-node"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/faye-websocket"
            },
            {
              "label": "Docs",
              "href": "https://registry.npmjs.org/faye-websocket/latest"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "faye-websocket handles WebSocket connections inside an existing Node.js HTTP server, using the same API that browsers expose. The app listens for the server's "
            },
            {
              "t": "code",
              "text": "upgrade"
            },
            {
              "t": "text",
              "text": " event, checks the request with "
            },
            {
              "t": "code",
              "text": "WebSocket.isWebSocket"
            },
            {
              "t": "text",
              "text": ", and creates a socket that emits "
            },
            {
              "t": "code",
              "text": "message"
            },
            {
              "t": "text",
              "text": " and "
            },
            {
              "t": "code",
              "text": "close"
            },
            {
              "t": "text",
              "text": " events and sends with "
            },
            {
              "t": "code",
              "text": "send"
            },
            {
              "t": "text",
              "text": ". The package also includes a WebSocket client and an "
            },
            {
              "t": "code",
              "text": "EventSource"
            },
            {
              "t": "text",
              "text": " handler for one-way server push over plain HTTP. It came out of the Faye messaging project and contains no server of its own."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F143"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/faye-websocket/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F142"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F267"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F268"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F269"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F270"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F271"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F272"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/faye/faye",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F157"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "function(request, socket, head) {\n    var options  = { maxLength: this._getMaxLength(), extensions: this._extensions, ping: this._options.ping },\n        ws       = new WebSocket(request, socket, head, [], options),\n        clientId = null,\n        self     = this;\n\n    request.originalUrl = request.url;\n\n    ws.onmessage = function(event) {\n      try {\n        self.debug('Received message via WebSocket[' + ws.version + ']: ?', event.data);\n\n        var message = self._parseJSON(event.data),\n            cid     = idFromMessages(message);\n\n        if (clientId && cid && cid !== clientId) self._server.closeSocket(clientId, false);\n        self._server.openSocket(cid, ws, request);\n        if (cid) clientId = cid;\n\n        self._server.process(message, request, function(replies) {\n          if (ws) ws.send(toJSON(replies));\n        });\n      } catch (error) {\n        console.log(error.stack);\n        self.error(error.message + '\\nBacktrace:\\n' + error.stack);\n      }\n    };\n\n    ws.onclose = function(event) {\n      self._server.closeSocket(clientId);\n      ws = null;\n    };\n  }\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/faye/faye/blob/96df432613dca46baa6e4ed78dadda775c6c46ee/src/adapters/node_adapter.js",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F156"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=faye-websocket%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F142"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "const http = require(\"node:http\");\nconst WebSocket = require(\"faye-websocket\");\nconst server = http.createServer();\nserver.on(\"upgrade\", (request, socket, head) => {\n  if (!WebSocket.isWebSocket(request)) return socket.destroy();\n  const connection = new WebSocket(request, socket, head);\n  connection.send(\"Hello\");\n});\nserver.listen(8080);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/faye-websocket/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F147"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "websocket-driver",
          "name": [
            {
              "t": "fact",
              "fact": "F159"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/faye/websocket-driver-node"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/websocket-driver"
            },
            {
              "label": "Docs",
              "href": "https://registry.npmjs.org/websocket-driver/latest"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "websocket-driver implements the WebSocket protocol without doing any input or output itself, so it runs over any stream the app supplies. The driver selects the right protocol version for each client, performs the opening and closing handshakes, recombines fragmented messages, and answers ping frames with pongs. The app pipes bytes from a TCP socket or HTTP upgrade into the driver and writes the bytes it produces back out. faye-websocket is built on top of it."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/websocket-driver/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F159"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F273"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F274"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F275"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F276"
                }
              ]
            }
          ],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/faye/faye-websocket-node",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F174"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "var WebSocket = function(request, socket, body, protocols, options) {\n  options = options || {};\n\n  this._stream = socket;\n\n  this._driver = driver.http(request, {\n    maxLength: options.maxLength,\n    protocols: protocols,\n    allowDrafts: options.allowDrafts\n  });\n\n  var self = this;\n  if (!this._stream || !this._stream.writable) return;\n  if (!this._stream.readable) return this._stream.end();\n\n  var catchup = function() { self._stream.removeListener('data', catchup) };\n  this._stream.on('data', catchup);\n\n  API.call(this, options);\n\n  process.nextTick(function() {\n    self._driver.start();\n    self._driver.io.write(body);\n  });\n};\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/faye/faye-websocket-node/blob/35243279ea1f759cf68fe99229b326145ad3513d/lib/faye/websocket.js",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F173"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=websocket-driver%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F159"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "const http = require(\"node:http\");\nconst websocket = require(\"websocket-driver\");\nconst server = http.createServer();\nserver.on(\"upgrade\", (request, socket, head) => {\n  if (!websocket.isWebSocket(request)) return socket.destroy();\n  const driver = websocket.http(request);\n  driver.io.write(head);\n  socket.pipe(driver.io).pipe(socket);\n  driver.start();\n  driver.text(\"Hello\");\n});\nserver.listen(8080);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/websocket-driver/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F164"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "crossws",
          "name": [
            {
              "t": "fact",
              "fact": "F176"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/h3js/crossws"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/crossws"
            },
            {
              "label": "Docs",
              "href": "https://crossws.h3.dev/adapters/node"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "crossws defines one set of WebSocket server hooks, such as "
            },
            {
              "t": "code",
              "text": "open"
            },
            {
              "t": "text",
              "text": ", "
            },
            {
              "t": "code",
              "text": "message"
            },
            {
              "t": "text",
              "text": ", and "
            },
            {
              "t": "code",
              "text": "close"
            },
            {
              "t": "text",
              "text": ", and runs them on Node.js, Bun, Deno, and Cloudflare Workers through an adapter for each runtime. Each hook receives a "
            },
            {
              "t": "code",
              "text": "peer"
            },
            {
              "t": "text",
              "text": " object that sends messages and can subscribe to topics for publish and subscribe. The Node.js adapter ships with ws built in, and a separate adapter uses uWebSockets."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://crossws.h3.dev/adapters/node",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F176"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F277"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F278"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F279"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F280"
                }
              ]
            }
          ],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/nitrojs/nitro",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F191"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "message(peer, message) {\n    if (message.text().includes(\"ping\")) {\n      peer.send({ user: \"server\", message: \"pong\" });\n    } else {\n      const msg = {\n        user: peer.toString(),\n        message: message.toString(),\n      };\n      peer.send(msg); // echo\n      peer.publish(\"chat\", msg);\n    }\n  }\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/nitrojs/nitro/blob/749b12bc82dfa75ef99c9a4b0d33b2278d7aa4b8/examples/websocket/routes/_ws.ts",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F190"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=crossws%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F176"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { createServer } from \"node:http\";\nimport crossws from \"crossws/adapters/node\";\nconst adapter = crossws({ hooks: { open(peer) { peer.send(\"Hello\"); } } });\nconst server = createServer((request, response) => response.end(\"WebSocket server\"));\nserver.on(\"upgrade\", (request, socket, head) => adapter.handleUpgrade(request, socket, head));\nserver.listen(8080);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/crossws/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "node.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F181"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "socket-io",
          "name": [
            {
              "t": "fact",
              "fact": "F193"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/socketio/socket.io"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/socket.io"
            },
            {
              "label": "Docs",
              "href": "https://registry.npmjs.org/socket.io/latest"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "Socket.IO sends named events between a server and its clients, such as "
            },
            {
              "t": "code",
              "text": "socket.emit('hello', 'world')"
            },
            {
              "t": "text",
              "text": ", with optional acknowledgements that work like callbacks. A connection starts over HTTP long-polling and upgrades to WebSocket when the network allows it. Sockets can join rooms, and a broadcast to a room reaches every socket in it. Socket.IO uses its own protocol on top of WebSocket, so browsers connect with the Socket.IO client library rather than the built-in "
            },
            {
              "t": "code",
              "text": "WebSocket"
            },
            {
              "t": "text",
              "text": " object."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/socket.io/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F193"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/nestjs/nest",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F206"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "public createIOServer(\n  port: number | undefined,\n  options?: ServerOptions,\n): Server {\n  if (this.httpServer && port === 0) {\n    return new Server(this.httpServer, options);\n  }\n  return new Server(port, options);\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/nestjs/nest/blob/09b656cb8df02a5f6ae1d0c5f1a0f2fadf7bc43c/packages/platform-socket.io/adapters/io-adapter.ts",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F205"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20socket.io%20for%20WebSocket%20communication&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F193"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { Server } from \"socket.io\";\nconst server = new Server(3000);\nserver.on(\"connection\", (socket) => socket.emit(\"hello\", \"world\"));\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/socket.io/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F198"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "engine-io",
          "name": [
            {
              "t": "fact",
              "fact": "F208"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/socketio/socket.io"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/engine.io"
            },
            {
              "label": "Docs",
              "href": "https://registry.npmjs.org/engine.io/latest"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "Engine.IO is the transport layer underneath Socket.IO. It opens a two-way connection between a Node.js server and a client over HTTP long-polling first, then upgrades to WebSocket or WebTransport when possible. "
            },
            {
              "t": "code",
              "text": "engine.attach"
            },
            {
              "t": "text",
              "text": " adds it to an existing HTTP server, and each connection emits "
            },
            {
              "t": "code",
              "text": "message"
            },
            {
              "t": "text",
              "text": " events and sends with "
            },
            {
              "t": "code",
              "text": "send"
            },
            {
              "t": "text",
              "text": ". It has no rooms or named events, which Socket.IO adds on top, and its code now lives in the Socket.IO monorepo."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/engine.io/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F208"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F281"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F282"
                }
              ]
            }
          ],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/primus/primus",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F223"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "function server() {\n  this.service = new engine.Server(Object.assign({\n    perMessageDeflate: !!this.primus.options.compression,\n    httpCompression: !!this.primus.options.compression,\n    maxHttpBufferSize: this.primus.options.maxLength\n  }, this.primus.options.transport));\n\n  //\n  // We've received a new connection, create a new Spark. The Spark will\n  // automatically announce it self as a new connection once it's created (after\n  // the next tick).\n  //\n  this.service.on('connection', (socket) => {\n    const spark = new this.Spark(\n        socket.request.headers  // HTTP request headers.\n      , socket.request.primus   // IP Address location.\n      , socket.request.query    // Optional query string.\n      , socket.id               // Unique connection id.\n      , socket.request          // Reference to the HTTP req.\n      , socket                  // Reference to the Engine.IO socket.\n    );\n\n    spark.on('outgoing::end', () => socket && socket.close());\n    spark.on('outgoing::data', (data) => socket.write(data));\n\n    socket.on('error', spark.emits('incoming::error'));\n    socket.on('data', spark.emits('incoming::data'));\n    socket.on('close', spark.emits('incoming::end', (next) => {\n      socket.removeAllListeners();\n      socket = null;\n      next();\n    }));\n  });\n\n  //\n  // Listen to upgrade requests.\n  //\n  this.on('upgrade', (req, socket, head) => {\n    this.service.handleUpgrade(req, socket, head);\n  }).on('request', (req, res) => {\n    //\n    // Engine.IO closes the handshake socket before we receive a `connection`\n    // event. And as the socket is already answered it can be undefined.\n    //\n    req.primus = {\n      remoteAddress: req.socket.remoteAddress,\n      remotePort: req.socket.remotePort\n    };\n\n    this.service.handleRequest(req, res);\n  }).once('close',  () => this.service.close());\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/primus/primus/blob/7158e36b361c473a915c7df51bfaab199fceeec3/transformers/engine.io/server.js#L12-L63",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F222"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=engine.io%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F208"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "const http = require(\"node:http\");\nconst engine = require(\"engine.io\");\nconst server = http.createServer();\nconst transport = engine.attach(server);\ntransport.on(\"connection\", (socket) => socket.send(\"Hello\"));\nserver.listen(8080);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/engine.io/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F213"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "sockjs-node",
          "name": [
            {
              "t": "fact",
              "fact": "F225"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/sockjs/sockjs-node"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/sockjs"
            },
            {
              "label": "Docs",
              "href": "https://registry.npmjs.org/sockjs/latest"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "SockJS-node is the Node.js server for SockJS, a protocol that gives browsers a WebSocket-like object even where WebSocket is blocked. The SockJS client in the browser tries WebSocket first and falls back to HTTP streaming or polling. On the server, "
            },
            {
              "t": "code",
              "text": "sockjs.createServer"
            },
            {
              "t": "text",
              "text": " returns a server whose "
            },
            {
              "t": "code",
              "text": "installHandlers"
            },
            {
              "t": "text",
              "text": " call mounts it under a URL prefix on an existing HTTP server. Each connection emits "
            },
            {
              "t": "code",
              "text": "data"
            },
            {
              "t": "text",
              "text": " events and sends with "
            },
            {
              "t": "code",
              "text": "write"
            },
            {
              "t": "text",
              "text": ", which takes strings only."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/sockjs/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F225"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F63"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F70"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/CodeboxIDE/codebox",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F238"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "var init = function(server, config) {\n    var socket = sockjs.createServer({\n        log: logger.log.bind(logger)\n    });\n\n    socket.on('connection', function(conn) {\n        var service = (conn.pathname.split(\"/\"))[2];\n        logger.log(\"connection to service '\"+service+\"'\");\n\n        if (!services[service]) {\n            conn.close(404, \"Service not found\");\n            return logger.error(\"invalid service '\"+service+\"'\");\n        }\n\n        conn.do = function(method, data) {\n            this.write(JSON.stringify({\n                'method': method,\n                'data': data\n            }));\n        }.bind(conn);\n\n        conn.on(\"data\", function(data) {\n            try {\n                data = JSON.parse(data);\n            } catch(e) {\n                logger.error(\"error parsing data:\", data);\n                return;\n            }\n\n            if (data.method) {\n                conn.emit(\"do.\"+data.method, data.data || {});\n            } else {\n                conn.emit(\"message\", data);\n            }\n        });\n\n        services[service].handler(conn);\n    });\n\n    socket.installHandlers(server, {\n        prefix: '^/socket/(\\\\w+)'\n    });\n};\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/CodeboxIDE/codebox/blob/98b4710f1bdba615dddbab56011a86cd5f16897b/lib/socket.js",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F237"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20sockjs%20for%20WebSocket%20communication&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F225"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "var http = require('http');\nvar sockjs = require('sockjs');\n\nvar echo = sockjs.createServer();\necho.on('connection', function(conn) {\n    conn.on('data', function(message) {\n        conn.write(message);\n    });\n    conn.on('close', function() {});\n});\n\nvar server = http.createServer();\necho.installHandlers(server, {prefix:'/echo'});\nserver.listen(9999, '0.0.0.0');\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/sockjs/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F230"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "graphql-ws",
          "name": [
            {
              "t": "fact",
              "fact": "F240"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/enisdenjo/graphql-ws"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/graphql-ws"
            },
            {
              "label": "Docs",
              "href": "https://api.github.com/repos/enisdenjo/graphql-ws/contents/src/use/ws.ts"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "graphql-ws implements the GraphQL over WebSocket Protocol, which carries GraphQL queries, mutations, and subscriptions over one WebSocket connection. On the server, "
            },
            {
              "t": "code",
              "text": "useServer"
            },
            {
              "t": "text",
              "text": " attaches a GraphQL schema to a ws server, and the client side calls "
            },
            {
              "t": "code",
              "text": "createClient"
            },
            {
              "t": "text",
              "text": " with the server's URL. The package has no dependencies. It is not compatible with the deprecated subscriptions-transport-ws protocol, so the server and every client have to use it."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F241"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/enisdenjo/graphql-ws/contents/src/use/ws.ts",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F240"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F283"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F284"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F285"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F286"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/prisma/prisma-examples",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F255"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "async function start() {\n  /** Create WS Server */\n  const wsServer = new WebSocketServer({\n    server: httpServer,\n    path: '/graphql',\n  })\n\n  /** hand-in created schema and have the WS Server start listening */\n  const serverCleanup = useServer({ schema, context }, wsServer)\n\n  const server = new ApolloServer<Context>({\n    schema,\n    plugins: [\n      ApolloServerPluginDrainHttpServer({ httpServer }),\n      {\n        async serverWillStart() {\n          return {\n            async drainServer() {\n              await serverCleanup.dispose()\n            },\n          }\n        },\n      },\n    ],\n  })\n\n  await server.start()\n  app.use('/graphql', cors<cors.CorsRequest>(), express.json(), expressMiddleware(server, { context: async () => context }));\n\n  httpServer.listen(PORT, () => {\n    console.log(`🚀 Server ready at http://localhost:${PORT}/graphql`)\n    console.log(`⏰ Subscriptions ready at http://localhost:${PORT}/graphql`)\n    console.log(\n      `⭐️ See sample queries: http://pris.ly/e/ts/graphql-subscriptions#using-the-graphql-api`,\n    )\n  })\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/prisma/prisma-examples/blob/45d6bf6193c66bc869240df90c75b2e4b45d008f/orm/graphql-subscriptions/src/server.ts",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F254"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=graphql-ws%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F240"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { GraphQLObjectType, GraphQLSchema, GraphQLString } from \"graphql\";\nimport { WebSocketServer } from \"ws\";\nimport { useServer } from \"graphql-ws/use/ws\";\nconst schema = new GraphQLSchema({ query: new GraphQLObjectType({ name: \"Query\", fields: { hello: { type: GraphQLString, resolve: () => \"Hello\" } } }) });\nuseServer({ schema }, new WebSocketServer({ port: 4000 }));\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/graphql-ws/latest",
                  "label": [
                    {
                      "t": "text",
                      "text": "ws.ts"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F245"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which JavaScript WebSocket library should I use?",
      "a": [
        {
          "t": "text",
          "text": "For a plain WebSocket server in Node.js, use "
        },
        {
          "t": "link",
          "href": "#ws",
          "label": [
            {
              "t": "text",
              "text": "ws"
            }
          ]
        },
        {
          "t": "text",
          "text": ", which browsers reach through their built-in "
        },
        {
          "t": "code",
          "text": "WebSocket"
        },
        {
          "t": "text",
          "text": " object. For rooms, broadcasts, and fallback to HTTP long-polling, use "
        },
        {
          "t": "link",
          "href": "#socket-io",
          "label": [
            {
              "t": "text",
              "text": "Socket.IO"
            }
          ]
        },
        {
          "t": "text",
          "text": " with its client library. For one server that runs on Node.js, Bun, Deno, and Cloudflare Workers, use "
        },
        {
          "t": "link",
          "href": "#crossws",
          "label": [
            {
              "t": "text",
              "text": "crossws"
            }
          ]
        },
        {
          "t": "text",
          "text": ", and for GraphQL subscriptions, "
        },
        {
          "t": "link",
          "href": "#graphql-ws",
          "label": [
            {
              "t": "text",
              "text": "graphql-ws"
            }
          ]
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "q": "How do I create a WebSocket server in Node.js?",
      "a": [
        {
          "t": "text",
          "text": "Install "
        },
        {
          "t": "link",
          "href": "#ws",
          "label": [
            {
              "t": "text",
              "text": "ws"
            }
          ]
        },
        {
          "t": "text",
          "text": ", create a "
        },
        {
          "t": "code",
          "text": "WebSocketServer"
        },
        {
          "t": "text",
          "text": " on a port, and listen for its "
        },
        {
          "t": "code",
          "text": "connection"
        },
        {
          "t": "text",
          "text": " event. Each connection's "
        },
        {
          "t": "code",
          "text": "send"
        },
        {
          "t": "text",
          "text": " method writes a message, and its "
        },
        {
          "t": "code",
          "text": "message"
        },
        {
          "t": "text",
          "text": " event fires for every message the client sends."
        }
      ]
    },
    {
      "q": "Socket.IO vs ws: which should I use?",
      "a": [
        {
          "t": "text",
          "text": "ws implements the WebSocket protocol, so any WebSocket client can connect, including the browser's built-in one. Socket.IO adds its own protocol on top, with rooms, acknowledgements, and fallback to HTTP long-polling, and only a Socket.IO client can connect to its server."
        }
      ]
    },
    {
      "q": "What is graphql-ws?",
      "a": [
        {
          "t": "text",
          "text": "graphql-ws implements the GraphQL over WebSocket Protocol for both server and client, with no dependencies. It isn't compatible with the deprecated subscriptions-transport-ws package, so the server and the client both have to use it."
        }
      ]
    },
    {
      "q": "SockJS vs Socket.IO: which should I use?",
      "a": [
        {
          "t": "text",
          "text": "Both fall back to HTTP transports when WebSocket is unavailable. SockJS gives the browser a WebSocket-like object and sends text messages only. Socket.IO sends named events and adds rooms and acknowledgements."
        }
      ]
    },
    {
      "q": "Does Socket.IO need sticky sessions?",
      "a": [
        {
          "t": "text",
          "text": "Yes, while HTTP long-polling is on: every request in a session has to reach the server that started it. Turning long-polling off and using WebSocket only removes that requirement."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, ws",
      "display": "ws",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, ws",
      "display": "1.5B",
      "asOf": "2026-11-15"
    },
    "F3": {
      "label": "License, ws",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, ws",
      "display": "8.23.0",
      "asOf": "2026-11-17"
    },
    "F5": {
      "label": "Undated package release, ws",
      "display": "v8.23.0",
      "asOf": "2026-11-17"
    },
    "F6": {
      "label": "Repository stars, ws",
      "display": "22.8K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Shares HTTP server, ws",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Binary messages, ws",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Per-message compression, ws",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Install, ws",
      "display": "npm install ws",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "What it does, ws",
      "display": "Implements WebSocket clients and servers for Node.js.",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "strengths lead, ws",
      "display": "Works with standard WebSocket clients",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths, ws",
      "display": "Browsers connect with their built-in WebSocket object.",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths lead, ws",
      "display": "Shares an existing HTTP server",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths, ws",
      "display": "Handles WebSocket upgrades on the same HTTP server as the app.",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "limitations lead, ws",
      "display": "Browser clients need another API",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations, ws",
      "display": "In the browser, the native WebSocket object takes its place.",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations lead, ws",
      "display": "Compression adds memory overhead",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations, ws",
      "display": "The permessage-deflate extension costs speed and memory, so it's off by default on the server.",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "Quickstart, ws",
      "display": "import { WebSocketServer } from 'ws';\n\nconst wss = new WebSocketServer({ port: 8080 });\n\nwss.on('connection', function connection(ws) {\n  ws.on('error', console.error);\n\n  ws.on('message', function message(data) {\n    console.log('received: %s', data);\n  });\n\n  ws.send('something');\n});\n",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Project function, ws",
      "display": "static create(\n    url: string,\n    headers: Record<string, string> | undefined,\n    logger: Logger,\n    options: NodeWebSocketTransportOptions = {},\n  ): Promise<NodeWebSocketTransport> {\n    return new Promise((resolve, reject) => {\n      const ws = new NodeWebSocket(url, [], {\n        followRedirects: true,\n        perMessageDeflate: false,\n        allowSynchronousEvents: false,\n        maxPayload: options.maxPayload ?? DEFAULT_MAX_PAYLOAD_BYTES,\n        handshakeTimeout: options.handshakeTimeout,\n        headers: {\n          'User-Agent': `Puppeteer ${packageVersion}`,\n          ...headers,\n        },\n      });\n\n      ws.addEventListener('open', () => {\n        return resolve(new NodeWebSocketTransport(ws, logger, options));\n      });\n      ws.addEventListener('error', reject);\n    });\n  }\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function reference, ws",
      "display": "NodeWebSocketTransport.ts · create()",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project repository, ws",
      "display": "puppeteer/puppeteer",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project stars, puppeteer/puppeteer",
      "display": "95.8K",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project push date, puppeteer/puppeteer",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F26": {
      "label": "Library name, socket.io",
      "display": "Socket.IO",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Monthly downloads, socket.io",
      "display": "97.5M",
      "asOf": "2026-11-15"
    },
    "F28": {
      "label": "License, socket.io",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Package release, socket.io",
      "display": "4.8.4",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Undated package release, socket.io",
      "display": "v4.8.4",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Repository stars, socket.io",
      "display": "63.2K",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Shares HTTP server, socket.io",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "HTTP fallback, socket.io",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Binary messages, socket.io",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Per-message compression, socket.io",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Install, socket.io",
      "display": "npm install socket.io",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "What it does, socket.io",
      "display": "Provides event-based communication with transport fallback, acknowledgements, and broadcasting.",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths lead, socket.io",
      "display": "Falls back to HTTP polling",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths, socket.io",
      "display": "Event connections keep working when a network blocks WebSocket.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths lead, socket.io",
      "display": "Broadcasts to selected groups",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths, socket.io",
      "display": "Rooms send events to a chosen group of connected clients.",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "limitations lead, socket.io",
      "display": "Requires a Socket.IO client",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations, socket.io",
      "display": "A plain WebSocket client cannot connect to a Socket.IO server.",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations lead, socket.io",
      "display": "Missed events need application storage",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations, socket.io",
      "display": "Server events sent during a disconnect are lost unless the app stores them.",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Quickstart, socket.io",
      "display": "const server = require('http').createServer();\nconst io = require('socket.io')(server);\nio.on('connection', client => {\n  client.on('event', data => { /* … */ });\n  client.on('disconnect', () => { /* … */ });\n});\nserver.listen(3000);\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function, socket.io",
      "display": "public createIOServer(\n    port: number | undefined,\n    options?: ServerOptions,\n  ): Server {\n    if (this.httpServer && port === 0) {\n      return new Server(this.httpServer, options);\n    }\n    return new Server(port, options);\n  }\n",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project function reference, socket.io",
      "display": "io-adapter.ts · createIOServer()",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project repository, socket.io",
      "display": "nestjs/nest",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project stars, nestjs/nest",
      "display": "77.1K",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project push date, nestjs/nest",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F52": {
      "label": "Library name, sockjs",
      "display": "SockJS-node",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Monthly downloads, sockjs",
      "display": "64.1M",
      "asOf": "2026-11-15"
    },
    "F54": {
      "label": "License, sockjs",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Package release, sockjs",
      "display": "0.3.24",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Undated package release, sockjs",
      "display": "v0.3.24",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Repository stars, sockjs",
      "display": "2.1K",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Shares HTTP server, sockjs",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "HTTP fallback, sockjs",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Binary messages, sockjs",
      "display": "Unsupported",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Install, sockjs",
      "display": "npm install sockjs",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "What it does, sockjs",
      "display": "Provides the Node.js server side of a browser transport-fallback protocol.",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "strengths lead, sockjs",
      "display": "Works without WebSocket transport",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths, sockjs",
      "display": "The browser gets a WebSocket-like connection over fallback transports.",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths lead, sockjs",
      "display": "Shares an existing HTTP server",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths, sockjs",
      "display": "Handlers install under a URL prefix next to other HTTP handlers.",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "limitations lead, sockjs",
      "display": "Messages must be strings",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations, sockjs",
      "display": "Structured or binary data has to be encoded as text before write.",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations lead, sockjs",
      "display": "Multiple servers need session affinity",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "limitations, sockjs",
      "display": "Every request in a session has to reach the same server.",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Quickstart, sockjs",
      "display": "var http = require('http');\nvar sockjs = require('sockjs');\n\nvar echo = sockjs.createServer();\necho.on('connection', function(conn) {\n    conn.on('data', function(message) {\n        conn.write(message);\n    });\n    conn.on('close', function() {});\n});\n\nvar server = http.createServer();\necho.installHandlers(server, {prefix:'/echo'});\nserver.listen(9999, '0.0.0.0');\n",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Project function, sockjs",
      "display": "var init = function(server, config) {\n    var socket = sockjs.createServer({\n        log: logger.log.bind(logger)\n    });\n\n    socket.on('connection', function(conn) {\n        var service = (conn.pathname.split(\"/\"))[2];\n        logger.log(\"connection to service '\"+service+\"'\");\n\n        if (!services[service]) {\n            conn.close(404, \"Service not found\");\n            return logger.error(\"invalid service '\"+service+\"'\");\n        }\n\n        conn.do = function(method, data) {\n            this.write(JSON.stringify({\n                'method': method,\n                'data': data\n            }));\n        }.bind(conn);\n\n        conn.on(\"data\", function(data) {\n            try {\n                data = JSON.parse(data);\n            } catch(e) {\n                logger.error(\"error parsing data:\", data);\n                return;\n            }\n\n            if (data.method) {\n                conn.emit(\"do.\"+data.method, data.data || {});\n            } else {\n                conn.emit(\"message\", data);\n            }\n        });\n\n        services[service].handler(conn);\n    });\n\n    socket.installHandlers(server, {\n        prefix: '^/socket/(\\\\w+)'\n    });\n};\n",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project function reference, sockjs",
      "display": "socket.js · init()",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Project repository, sockjs",
      "display": "CodeboxIDE/codebox",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Project stars, CodeboxIDE/codebox",
      "display": "4.2K",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Project push date, CodeboxIDE/codebox",
      "display": "Oct 2023",
      "asOf": "2023-10-17"
    },
    "F77": {
      "label": "Library name, websocket",
      "display": "WebSocket-Node",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Monthly downloads, websocket",
      "display": "6.4M",
      "asOf": "2026-11-15"
    },
    "F79": {
      "label": "License, websocket",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Package release, websocket",
      "display": "1.0.35",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Undated package release, websocket",
      "display": "v1.0.35",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Repository stars, websocket",
      "display": "3.8K",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Shares HTTP server, websocket",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "Binary messages, websocket",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Per-message compression, websocket",
      "display": "Unsupported",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Install, websocket",
      "display": "npm install websocket",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "What it does, websocket",
      "display": "Implements Node.js WebSocket clients and servers with configurable framing.",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "strengths lead, websocket",
      "display": "Controls message fragmentation",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "strengths, websocket",
      "display": "Choose fragment sizes and whether received fragments are assembled.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "strengths lead, websocket",
      "display": "Sends text and binary messages",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "strengths, websocket",
      "display": "Use sendUTF for text and sendBytes for Buffer payloads.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "limitations lead, websocket",
      "display": "Negotiated extensions remain unused",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "limitations, websocket",
      "display": "Choose another implementation when negotiated WebSocket extensions are required.",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "limitations lead, websocket",
      "display": "Automatic acceptance skips origin checks",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "limitations, websocket",
      "display": "Inspect requests before accepting connections from untrusted origins.",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Quickstart, websocket",
      "display": "#!/usr/bin/env node\nvar WebSocketServer = require('websocket').server;\nvar http = require('http');\n\nvar server = http.createServer(function(request, response) {\n    console.log((new Date()) + ' Received request for ' + request.url);\n    response.writeHead(404);\n    response.end();\n});\nserver.listen(8080, function() {\n    console.log((new Date()) + ' Server is listening on port 8080');\n});\n\nwsServer = new WebSocketServer({\n    httpServer: server,\n    // You should not use autoAcceptConnections for production\n    // applications, as it defeats all standard cross-origin protection\n    // facilities built into the protocol and the browser.  You should\n    // *always* verify the connection's origin and decide whether or not\n    // to accept it.\n    autoAcceptConnections: false\n});\n\nfunction originIsAllowed(origin) {\n  // put logic here to detect whether the specified origin is allowed.\n  return true;\n}\n\nwsServer.on('request', function(request) {\n    if (!originIsAllowed(request.origin)) {\n      // Make sure we only accept requests from an allowed origin\n      request.reject();\n      console.log((new Date()) + ' Connection from origin ' + request.origin + ' rejected.');\n      return;\n    }\n    \n    var connection = request.accept('echo-protocol', request.origin);\n    console.log((new Date()) + ' Connection accepted.');\n    connection.on('message', function(message) {\n        if (message.type === 'utf8') {\n            console.log('Received Message: ' + message.utf8Data);\n            connection.sendUTF(message.utf8Data);\n        }\n        else if (message.type === 'binary') {\n            console.log('Received Binary Message of ' + message.binaryData.length + ' bytes');\n            connection.sendBytes(message.binaryData);\n        }\n    });\n    connection.on('close', function(reasonCode, description) {\n        console.log((new Date()) + ' Peer ' + connection.remoteAddress + ' disconnected.');\n    });\n});\n",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Developer need",
      "display": "Connecting standard WebSocket clients",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Why choose ws",
      "display": "standard browser WebSocket integration",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Developer need in introduction",
      "display": "connecting standard WebSocket clients",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Developer need",
      "display": "Sending events to selected client groups",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Why choose socket.io",
      "display": "named room broadcasts",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Developer need in introduction",
      "display": "sending events to selected client groups",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "When to consider ws",
      "display": "plain WebSocket clients must connect",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Developer need",
      "display": "Supporting browser fallback transports",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Why choose sockjs",
      "display": "connections with or without WebSocket",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Developer need in introduction",
      "display": "supporting browser fallback transports",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Developer need",
      "display": "Controlling received frame assembly",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Why choose websocket",
      "display": "configurable fragmentation and assembly",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Developer need in introduction",
      "display": "controlling received frame assembly",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Page introduction",
      "display": "JavaScript WebSocket libraries let application developers exchange messages over WebSocket connections.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "FAQ: Can a native WebSocket client connect to Socket.IO?",
      "display": "Socket.IO adds its own packet metadata, so a plain WebSocket client cannot connect to its server.",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "FAQ: Can ws run inside the browser?",
      "display": "ws runs in Node.js; browser clients use the native WebSocket object.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Which packages provide transport fallback?",
      "display": "Socket.IO can begin with HTTP long-polling and upgrade transports.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: Which packages provide transport fallback?",
      "display": "SockJS provides browser communication with or without WebSocket.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Does reconnection guarantee Socket.IO message delivery?",
      "display": "Delivery is at most once by default; disconnected clients do not receive missed server events automatically.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: How can Socket.IO send to a subset of clients?",
      "display": "Sockets join rooms, and a broadcast to a room reaches the sockets that joined it.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Does Socket.IO need sticky sessions across servers?",
      "display": "Requests for a session must reach its originating server when using HTTP long-polling.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Does Socket.IO need sticky sessions across servers?",
      "display": "Disabling HTTP long-polling is one listed alternative to sticky sessions.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: What messages can the normal SockJS connection send?",
      "display": "Its write API requires a non-empty string; received messages are Unicode strings.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Can a standard WebSocket client reach SockJS?",
      "display": "SockJS also provides a separate raw WebSocket URL for RFC 6455 clients.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Can SockJS use cookie-based authorization directly?",
      "display": "SockJS deliberately withholds cookies from the application and describes sending a session token over the connection instead.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: What changes when ws compression is enabled?",
      "display": "permessage-deflate adds performance and memory overhead; its server default is disabled.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Does WebSocket-Node automatically accept every origin?",
      "display": "Automatic acceptance accepts clients from any origin; inspect the request when it is disabled.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Can these servers share an existing HTTP listener?",
      "display": "ws accepts an existing server in WebSocketServer options.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Can these servers share an existing HTTP listener?",
      "display": "WebSocket-Node requires an HTTP or HTTPS server to attach to.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Can these servers share an existing HTTP listener?",
      "display": "SockJS leaves requests outside its configured prefix to existing handlers.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "Library name, ws",
      "display": "ws",
      "asOf": "2026-11-19"
    },
    "F128": {
      "label": "Monthly downloads, ws",
      "display": "1.5B",
      "asOf": "2026-11-19"
    },
    "F129": {
      "label": "License, ws",
      "display": "MIT",
      "asOf": "2026-11-19"
    },
    "F130": {
      "label": "Package release, ws",
      "display": "8.23.0",
      "asOf": "2026-11-19"
    },
    "F131": {
      "label": "Package release date, ws",
      "display": "Nov 2026",
      "asOf": "2026-11-19"
    },
    "F132": {
      "label": "Install, ws",
      "display": "npm install ws@8.23.0",
      "asOf": "2026-11-19"
    },
    "F133": {
      "label": "Quickstart, ws",
      "display": "import { WebSocketServer } from \"ws\";\nconst server = new WebSocketServer({ port: 8080 });\nserver.on(\"connection\", (socket) => socket.send(\"Hello\"));\n",
      "asOf": "2026-11-19"
    },
    "F134": {
      "label": "Repository stars, ws",
      "display": "22.8K",
      "asOf": "2026-11-19"
    },
    "F135": {
      "label": "Binary application payloads, ws",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F136": {
      "label": "HTTP long-polling transport, ws",
      "display": "No",
      "asOf": "2026-11-19"
    },
    "F137": {
      "label": "Protocol and integration role, ws",
      "display": "Node.js WebSocket client/server implementation with a standard server interface and binary payload APIs. Browser clients use their native WebSocket; the full npm counter includes clients, servers, and transitive uses.",
      "asOf": "2026-11-19"
    },
    "F138": {
      "label": "Project function, ws",
      "display": "async function start() {\n  /** Create WS Server */\n  const wsServer = new WebSocketServer({\n    server: httpServer,\n    path: '/graphql',\n  })\n\n  /** hand-in created schema and have the WS Server start listening */\n  const serverCleanup = useServer({ schema, context }, wsServer)\n\n  const server = new ApolloServer<Context>({\n    schema,\n    plugins: [\n      ApolloServerPluginDrainHttpServer({ httpServer }),\n      {\n        async serverWillStart() {\n          return {\n            async drainServer() {\n              await serverCleanup.dispose()\n            },\n          }\n        },\n      },\n    ],\n  })\n\n  await server.start()\n  app.use('/graphql', cors<cors.CorsRequest>(), express.json(), expressMiddleware(server, { context: async () => context }));\n\n  httpServer.listen(PORT, () => {\n    console.log(`🚀 Server ready at http://localhost:${PORT}/graphql`)\n    console.log(`⏰ Subscriptions ready at http://localhost:${PORT}/graphql`)\n    console.log(\n      `⭐️ See sample queries: http://pris.ly/e/ts/graphql-subscriptions#using-the-graphql-api`,\n    )\n  })\n}\n",
      "asOf": "2026-11-19"
    },
    "F139": {
      "label": "Project source file, ws",
      "display": "orm/graphql-subscriptions/src/server.ts",
      "asOf": "2026-11-19"
    },
    "F140": {
      "label": "Project full_name, ws",
      "display": "prisma/prisma-examples",
      "asOf": "2026-11-19"
    },
    "F141": {
      "label": "Project stargazers_count, ws",
      "display": "6.7K",
      "asOf": "2026-11-19"
    },
    "F142": {
      "label": "Library name, faye-websocket",
      "display": "faye-websocket",
      "asOf": "2026-11-19"
    },
    "F143": {
      "label": "Monthly downloads, faye-websocket",
      "display": "156.8M",
      "asOf": "2026-11-19"
    },
    "F144": {
      "label": "License, faye-websocket",
      "display": "Apache-2.0",
      "asOf": "2026-11-19"
    },
    "F145": {
      "label": "Package release, faye-websocket",
      "display": "0.12.0",
      "asOf": "2026-11-19"
    },
    "F146": {
      "label": "Package release date, faye-websocket",
      "display": "Nov 2026",
      "asOf": "2026-11-19"
    },
    "F147": {
      "label": "Install, faye-websocket",
      "display": "npm install faye-websocket@0.12.0",
      "asOf": "2026-11-19"
    },
    "F148": {
      "label": "Quickstart, faye-websocket",
      "display": "const http = require(\"node:http\");\nconst WebSocket = require(\"faye-websocket\");\nconst server = http.createServer();\nserver.on(\"upgrade\", (request, socket, head) => {\n  if (!WebSocket.isWebSocket(request)) return socket.destroy();\n  const connection = new WebSocket(request, socket, head);\n  connection.send(\"Hello\");\n});\nserver.listen(8080);\n",
      "asOf": "2026-11-19"
    },
    "F149": {
      "label": "Official description, faye-websocket",
      "display": "Standards-compliant WebSocket server and client",
      "asOf": "2026-11-19"
    },
    "F150": {
      "label": "Quickstart source file, faye-websocket",
      "display": "README.md",
      "asOf": "2026-11-19"
    },
    "F151": {
      "label": "Repository stars, faye-websocket",
      "display": "612",
      "asOf": "2026-11-19"
    },
    "F152": {
      "label": "Binary application payloads, faye-websocket",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F153": {
      "label": "HTTP long-polling transport, faye-websocket",
      "display": "No",
      "asOf": "2026-11-19"
    },
    "F154": {
      "label": "Protocol and integration role, faye-websocket",
      "display": "Standard WebSocket API integrated into a caller-owned Node HTTP upgrade flow, plus a separate one-way EventSource abstraction. Higher-level Bayeux behavior in the example belongs to the Faye host project.",
      "asOf": "2026-11-19"
    },
    "F155": {
      "label": "Project function, faye-websocket",
      "display": "function(request, socket, head) {\n    var options  = { maxLength: this._getMaxLength(), extensions: this._extensions, ping: this._options.ping },\n        ws       = new WebSocket(request, socket, head, [], options),\n        clientId = null,\n        self     = this;\n\n    request.originalUrl = request.url;\n\n    ws.onmessage = function(event) {\n      try {\n        self.debug('Received message via WebSocket[' + ws.version + ']: ?', event.data);\n\n        var message = self._parseJSON(event.data),\n            cid     = idFromMessages(message);\n\n        if (clientId && cid && cid !== clientId) self._server.closeSocket(clientId, false);\n        self._server.openSocket(cid, ws, request);\n        if (cid) clientId = cid;\n\n        self._server.process(message, request, function(replies) {\n          if (ws) ws.send(toJSON(replies));\n        });\n      } catch (error) {\n        console.log(error.stack);\n        self.error(error.message + '\\nBacktrace:\\n' + error.stack);\n      }\n    };\n\n    ws.onclose = function(event) {\n      self._server.closeSocket(clientId);\n      ws = null;\n    };\n  }\n",
      "asOf": "2026-11-19"
    },
    "F156": {
      "label": "Project source file, faye-websocket",
      "display": "src/adapters/node_adapter.js",
      "asOf": "2026-11-19"
    },
    "F157": {
      "label": "Project full_name, faye-websocket",
      "display": "faye/faye",
      "asOf": "2026-11-19"
    },
    "F158": {
      "label": "Project stargazers_count, faye-websocket",
      "display": "4.4K",
      "asOf": "2026-11-19"
    },
    "F159": {
      "label": "Library name, websocket-driver",
      "display": "websocket-driver",
      "asOf": "2026-11-19"
    },
    "F160": {
      "label": "Monthly downloads, websocket-driver",
      "display": "155.4M",
      "asOf": "2026-11-19"
    },
    "F161": {
      "label": "License, websocket-driver",
      "display": "Apache-2.0",
      "asOf": "2026-11-19"
    },
    "F162": {
      "label": "Package release, websocket-driver",
      "display": "0.8.0",
      "asOf": "2026-11-19"
    },
    "F163": {
      "label": "Package release date, websocket-driver",
      "display": "Nov 2026",
      "asOf": "2026-11-19"
    },
    "F164": {
      "label": "Install, websocket-driver",
      "display": "npm install websocket-driver@0.8.0",
      "asOf": "2026-11-19"
    },
    "F165": {
      "label": "Quickstart, websocket-driver",
      "display": "const http = require(\"node:http\");\nconst websocket = require(\"websocket-driver\");\nconst server = http.createServer();\nserver.on(\"upgrade\", (request, socket, head) => {\n  if (!websocket.isWebSocket(request)) return socket.destroy();\n  const driver = websocket.http(request);\n  driver.io.write(head);\n  socket.pipe(driver.io).pipe(socket);\n  driver.start();\n  driver.text(\"Hello\");\n});\nserver.listen(8080);\n",
      "asOf": "2026-11-19"
    },
    "F166": {
      "label": "Official description, websocket-driver",
      "display": "WebSocket protocol handler with pluggable I/O",
      "asOf": "2026-11-19"
    },
    "F167": {
      "label": "Quickstart source file, websocket-driver",
      "display": "README.md",
      "asOf": "2026-11-19"
    },
    "F168": {
      "label": "Repository stars, websocket-driver",
      "display": "111",
      "asOf": "2026-11-19"
    },
    "F169": {
      "label": "Binary application payloads, websocket-driver",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F170": {
      "label": "HTTP long-polling transport, websocket-driver",
      "display": "No",
      "asOf": "2026-11-19"
    },
    "F171": {
      "label": "Protocol and integration role, websocket-driver",
      "display": "Complete WebSocket wire-protocol engine decoupled from I/O, with explicit HTTP/TCP driver factories, handshake control, and duplex streams. It is a lower-level transport interface distinct from the Faye WebSocket facade, with overlapping dependency installs.",
      "asOf": "2026-11-19"
    },
    "F172": {
      "label": "Project function, websocket-driver",
      "display": "var WebSocket = function(request, socket, body, protocols, options) {\n  options = options || {};\n\n  this._stream = socket;\n\n  this._driver = driver.http(request, {\n    maxLength: options.maxLength,\n    protocols: protocols,\n    allowDrafts: options.allowDrafts\n  });\n\n  var self = this;\n  if (!this._stream || !this._stream.writable) return;\n  if (!this._stream.readable) return this._stream.end();\n\n  var catchup = function() { self._stream.removeListener('data', catchup) };\n  this._stream.on('data', catchup);\n\n  API.call(this, options);\n\n  process.nextTick(function() {\n    self._driver.start();\n    self._driver.io.write(body);\n  });\n};\n",
      "asOf": "2026-11-19"
    },
    "F173": {
      "label": "Project source file, websocket-driver",
      "display": "lib/faye/websocket.js",
      "asOf": "2026-11-19"
    },
    "F174": {
      "label": "Project full_name, websocket-driver",
      "display": "faye/faye-websocket-node",
      "asOf": "2026-11-19"
    },
    "F175": {
      "label": "Project stargazers_count, websocket-driver",
      "display": "612",
      "asOf": "2026-11-19"
    },
    "F176": {
      "label": "Library name, crossws",
      "display": "crossws",
      "asOf": "2026-11-19"
    },
    "F177": {
      "label": "Monthly downloads, crossws",
      "display": "129.6M",
      "asOf": "2026-11-19"
    },
    "F178": {
      "label": "License, crossws",
      "display": "MIT",
      "asOf": "2026-11-19"
    },
    "F179": {
      "label": "Package release, crossws",
      "display": "0.4.17",
      "asOf": "2026-11-19"
    },
    "F180": {
      "label": "Package release date, crossws",
      "display": "Oct 2026",
      "asOf": "2026-11-19"
    },
    "F181": {
      "label": "Install, crossws",
      "display": "npm install crossws@0.4.17",
      "asOf": "2026-11-19"
    },
    "F182": {
      "label": "Quickstart, crossws",
      "display": "import { createServer } from \"node:http\";\nimport crossws from \"crossws/adapters/node\";\nconst adapter = crossws({ hooks: { open(peer) { peer.send(\"Hello\"); } } });\nconst server = createServer((request, response) => response.end(\"WebSocket server\"));\nserver.on(\"upgrade\", (request, socket, head) => adapter.handleUpgrade(request, socket, head));\nserver.listen(8080);\n",
      "asOf": "2026-11-19"
    },
    "F183": {
      "label": "Official description, crossws",
      "display": "Cross-platform WebSocket servers for Node.js, Deno, Bun, and Cloudflare Workers",
      "asOf": "2026-11-19"
    },
    "F184": {
      "label": "Quickstart source file, crossws",
      "display": "adapters/node",
      "asOf": "2026-11-19"
    },
    "F185": {
      "label": "Repository stars, crossws",
      "display": "745",
      "asOf": "2026-11-19"
    },
    "F186": {
      "label": "Binary application payloads, crossws",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F187": {
      "label": "HTTP long-polling transport, crossws",
      "display": "No",
      "asOf": "2026-11-19"
    },
    "F188": {
      "label": "Protocol and integration role, crossws",
      "display": "Cross-runtime server hooks and Peer/Message interface with Node/Bun/Deno/Workers adapters and namespace-scoped topic publish/subscribe. Node adapter prebundles ws; these dependency counts are not separate unique adopters.",
      "asOf": "2026-11-19"
    },
    "F189": {
      "label": "Project function, crossws",
      "display": "message(peer, message) {\n    if (message.text().includes(\"ping\")) {\n      peer.send({ user: \"server\", message: \"pong\" });\n    } else {\n      const msg = {\n        user: peer.toString(),\n        message: message.toString(),\n      };\n      peer.send(msg); // echo\n      peer.publish(\"chat\", msg);\n    }\n  }\n",
      "asOf": "2026-11-19"
    },
    "F190": {
      "label": "Project source file, crossws",
      "display": "examples/websocket/routes/_ws.ts",
      "asOf": "2026-11-19"
    },
    "F191": {
      "label": "Project full_name, crossws",
      "display": "nitrojs/nitro",
      "asOf": "2026-11-19"
    },
    "F192": {
      "label": "Project stargazers_count, crossws",
      "display": "11.4K",
      "asOf": "2026-11-19"
    },
    "F193": {
      "label": "Library name, socket.io",
      "display": "Socket.IO",
      "asOf": "2026-11-19"
    },
    "F194": {
      "label": "Monthly downloads, socket.io",
      "display": "100.0M",
      "asOf": "2026-11-19"
    },
    "F195": {
      "label": "License, socket.io",
      "display": "MIT",
      "asOf": "2026-11-19"
    },
    "F196": {
      "label": "Package release, socket.io",
      "display": "4.8.4",
      "asOf": "2026-11-19"
    },
    "F197": {
      "label": "Package release date, socket.io",
      "display": "Sep 2026",
      "asOf": "2026-11-19"
    },
    "F198": {
      "label": "Install, socket.io",
      "display": "npm install socket.io@4.8.4",
      "asOf": "2026-11-19"
    },
    "F199": {
      "label": "Quickstart, socket.io",
      "display": "import { Server } from \"socket.io\";\nconst server = new Server(3000);\nserver.on(\"connection\", (socket) => socket.emit(\"hello\", \"world\"));\n",
      "asOf": "2026-11-19"
    },
    "F200": {
      "label": "Repository stars, socket.io",
      "display": "63.3K",
      "asOf": "2026-11-19"
    },
    "F201": {
      "label": "Binary application payloads, socket.io",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F202": {
      "label": "HTTP long-polling transport, socket.io",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F203": {
      "label": "Protocol and integration role, socket.io",
      "display": "Real-time event protocol with rooms, namespaces, and Engine.IO transports including HTTP long-polling upgrades. A Socket.IO client is required for its event protocol; raw browser WebSocket is a different interface.",
      "asOf": "2026-11-19"
    },
    "F204": {
      "label": "Project function, socket.io",
      "display": "public createIOServer(\n  port: number | undefined,\n  options?: ServerOptions,\n): Server {\n  if (this.httpServer && port === 0) {\n    return new Server(this.httpServer, options);\n  }\n  return new Server(port, options);\n}\n",
      "asOf": "2026-11-19"
    },
    "F205": {
      "label": "Project source file, socket.io",
      "display": "packages/platform-socket.io/adapters/io-adapter.ts",
      "asOf": "2026-11-19"
    },
    "F206": {
      "label": "Project full_name, socket.io",
      "display": "nestjs/nest",
      "asOf": "2026-11-19"
    },
    "F207": {
      "label": "Project stargazers_count, socket.io",
      "display": "77.1K",
      "asOf": "2026-11-19"
    },
    "F208": {
      "label": "Library name, engine.io",
      "display": "Engine.IO",
      "asOf": "2026-11-19"
    },
    "F209": {
      "label": "Monthly downloads, engine.io",
      "display": "97.4M",
      "asOf": "2026-11-19"
    },
    "F210": {
      "label": "License, engine.io",
      "display": "MIT",
      "asOf": "2026-11-19"
    },
    "F211": {
      "label": "Package release, engine.io",
      "display": "6.6.11",
      "asOf": "2026-11-19"
    },
    "F212": {
      "label": "Package release date, engine.io",
      "display": "Sep 2026",
      "asOf": "2026-11-19"
    },
    "F213": {
      "label": "Install, engine.io",
      "display": "npm install engine.io@6.6.11",
      "asOf": "2026-11-19"
    },
    "F214": {
      "label": "Quickstart, engine.io",
      "display": "const http = require(\"node:http\");\nconst engine = require(\"engine.io\");\nconst server = http.createServer();\nconst transport = engine.attach(server);\ntransport.on(\"connection\", (socket) => socket.send(\"Hello\"));\nserver.listen(8080);\n",
      "asOf": "2026-11-19"
    },
    "F215": {
      "label": "Official description, engine.io",
      "display": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server",
      "asOf": "2026-11-19"
    },
    "F216": {
      "label": "Quickstart source file, engine.io",
      "display": "README.md",
      "asOf": "2026-11-19"
    },
    "F217": {
      "label": "Repository stars, engine.io",
      "display": "63.3K",
      "asOf": "2026-11-19"
    },
    "F218": {
      "label": "Binary application payloads, engine.io",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F219": {
      "label": "HTTP long-polling transport, engine.io",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F220": {
      "label": "Protocol and integration role, engine.io",
      "display": "Underlying real-time transport packet protocol with polling and WebSocket transports, below Socket.IO's event/room API. Requires an Engine.IO-compatible client protocol; same monorepo and dependency family are disclosed, not pooled.",
      "asOf": "2026-11-19"
    },
    "F221": {
      "label": "Project function, engine.io",
      "display": "function server() {\n  this.service = new engine.Server(Object.assign({\n    perMessageDeflate: !!this.primus.options.compression,\n    httpCompression: !!this.primus.options.compression,\n    maxHttpBufferSize: this.primus.options.maxLength\n  }, this.primus.options.transport));\n\n  //\n  // We've received a new connection, create a new Spark. The Spark will\n  // automatically announce it self as a new connection once it's created (after\n  // the next tick).\n  //\n  this.service.on('connection', (socket) => {\n    const spark = new this.Spark(\n        socket.request.headers  // HTTP request headers.\n      , socket.request.primus   // IP Address location.\n      , socket.request.query    // Optional query string.\n      , socket.id               // Unique connection id.\n      , socket.request          // Reference to the HTTP req.\n      , socket                  // Reference to the Engine.IO socket.\n    );\n\n    spark.on('outgoing::end', () => socket && socket.close());\n    spark.on('outgoing::data', (data) => socket.write(data));\n\n    socket.on('error', spark.emits('incoming::error'));\n    socket.on('data', spark.emits('incoming::data'));\n    socket.on('close', spark.emits('incoming::end', (next) => {\n      socket.removeAllListeners();\n      socket = null;\n      next();\n    }));\n  });\n\n  //\n  // Listen to upgrade requests.\n  //\n  this.on('upgrade', (req, socket, head) => {\n    this.service.handleUpgrade(req, socket, head);\n  }).on('request', (req, res) => {\n    //\n    // Engine.IO closes the handshake socket before we receive a `connection`\n    // event. And as the socket is already answered it can be undefined.\n    //\n    req.primus = {\n      remoteAddress: req.socket.remoteAddress,\n      remotePort: req.socket.remotePort\n    };\n\n    this.service.handleRequest(req, res);\n  }).once('close',  () => this.service.close());\n}\n",
      "asOf": "2026-11-19"
    },
    "F222": {
      "label": "Project source file, engine.io",
      "display": "transformers/engine.io/server.js",
      "asOf": "2026-11-19"
    },
    "F223": {
      "label": "Project full_name, engine.io",
      "display": "primus/primus",
      "asOf": "2026-11-19"
    },
    "F224": {
      "label": "Project stargazers_count, engine.io",
      "display": "4.5K",
      "asOf": "2026-11-19"
    },
    "F225": {
      "label": "Library name, sockjs",
      "display": "SockJS",
      "asOf": "2026-11-19"
    },
    "F226": {
      "label": "Monthly downloads, sockjs",
      "display": "65.9M",
      "asOf": "2026-11-19"
    },
    "F227": {
      "label": "License, sockjs",
      "display": "MIT",
      "asOf": "2026-11-19"
    },
    "F228": {
      "label": "Package release, sockjs",
      "display": "0.3.24",
      "asOf": "2026-11-19"
    },
    "F229": {
      "label": "Package release date, sockjs",
      "display": "Dec 2021",
      "asOf": "2026-11-19"
    },
    "F230": {
      "label": "Install, sockjs",
      "display": "npm install sockjs@0.3.24",
      "asOf": "2026-11-19"
    },
    "F231": {
      "label": "Quickstart, sockjs",
      "display": "var http = require('http');\nvar sockjs = require('sockjs');\n\nvar echo = sockjs.createServer();\necho.on('connection', function(conn) {\n    conn.on('data', function(message) {\n        conn.write(message);\n    });\n    conn.on('close', function() {});\n});\n\nvar server = http.createServer();\necho.installHandlers(server, {prefix:'/echo'});\nserver.listen(9999, '0.0.0.0');\n",
      "asOf": "2026-11-19"
    },
    "F232": {
      "label": "Repository stars, sockjs",
      "display": "2.1K",
      "asOf": "2026-11-19"
    },
    "F233": {
      "label": "Binary application payloads, sockjs",
      "display": "No",
      "asOf": "2026-11-19"
    },
    "F234": {
      "label": "HTTP long-polling transport, sockjs",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F235": {
      "label": "Protocol and integration role, sockjs",
      "display": "SockJS server with browser-compatible fallback transports, including HTTP polling and streaming; its documented Connection.write message API is text-only. Full fallback behavior uses the SockJS client protocol.",
      "asOf": "2026-11-19"
    },
    "F236": {
      "label": "Project function, sockjs",
      "display": "var init = function(server, config) {\n    var socket = sockjs.createServer({\n        log: logger.log.bind(logger)\n    });\n\n    socket.on('connection', function(conn) {\n        var service = (conn.pathname.split(\"/\"))[2];\n        logger.log(\"connection to service '\"+service+\"'\");\n\n        if (!services[service]) {\n            conn.close(404, \"Service not found\");\n            return logger.error(\"invalid service '\"+service+\"'\");\n        }\n\n        conn.do = function(method, data) {\n            this.write(JSON.stringify({\n                'method': method,\n                'data': data\n            }));\n        }.bind(conn);\n\n        conn.on(\"data\", function(data) {\n            try {\n                data = JSON.parse(data);\n            } catch(e) {\n                logger.error(\"error parsing data:\", data);\n                return;\n            }\n\n            if (data.method) {\n                conn.emit(\"do.\"+data.method, data.data || {});\n            } else {\n                conn.emit(\"message\", data);\n            }\n        });\n\n        services[service].handler(conn);\n    });\n\n    socket.installHandlers(server, {\n        prefix: '^/socket/(\\\\w+)'\n    });\n};\n",
      "asOf": "2026-11-19"
    },
    "F237": {
      "label": "Project source file, sockjs",
      "display": "lib/socket.js",
      "asOf": "2026-11-19"
    },
    "F238": {
      "label": "Project full_name, sockjs",
      "display": "CodeboxIDE/codebox",
      "asOf": "2026-11-19"
    },
    "F239": {
      "label": "Project stargazers_count, sockjs",
      "display": "4.2K",
      "asOf": "2026-11-19"
    },
    "F240": {
      "label": "Library name, graphql-ws",
      "display": "graphql-ws",
      "asOf": "2026-11-19"
    },
    "F241": {
      "label": "Monthly downloads, graphql-ws",
      "display": "63.9M",
      "asOf": "2026-11-19"
    },
    "F242": {
      "label": "License, graphql-ws",
      "display": "MIT",
      "asOf": "2026-11-19"
    },
    "F243": {
      "label": "Package release, graphql-ws",
      "display": "6.4.3",
      "asOf": "2026-11-19"
    },
    "F244": {
      "label": "Package release date, graphql-ws",
      "display": "Nov 2026",
      "asOf": "2026-11-19"
    },
    "F245": {
      "label": "Install, graphql-ws",
      "display": "npm install graphql-ws@6.4.3 ws@8.23.0 graphql@16",
      "asOf": "2026-11-19"
    },
    "F246": {
      "label": "Quickstart, graphql-ws",
      "display": "import { GraphQLObjectType, GraphQLSchema, GraphQLString } from \"graphql\";\nimport { WebSocketServer } from \"ws\";\nimport { useServer } from \"graphql-ws/use/ws\";\nconst schema = new GraphQLSchema({ query: new GraphQLObjectType({ name: \"Query\", fields: { hello: { type: GraphQLString, resolve: () => \"Hello\" } } }) });\nuseServer({ schema }, new WebSocketServer({ port: 4000 }));\n",
      "asOf": "2026-11-19"
    },
    "F247": {
      "label": "Official description, graphql-ws",
      "display": "Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client",
      "asOf": "2026-11-19"
    },
    "F248": {
      "label": "Quickstart source file, graphql-ws",
      "display": "src/use/ws.ts",
      "asOf": "2026-11-19"
    },
    "F249": {
      "label": "Repository stars, graphql-ws",
      "display": "1.9K",
      "asOf": "2026-11-19"
    },
    "F250": {
      "label": "Binary application payloads, graphql-ws",
      "display": "No",
      "asOf": "2026-11-19"
    },
    "F251": {
      "label": "HTTP long-polling transport, graphql-ws",
      "display": "No",
      "asOf": "2026-11-19"
    },
    "F252": {
      "label": "Protocol and integration role, graphql-ws",
      "display": "GraphQL-over-WebSocket server/client protocol using structured JSON operation messages and a GraphQL schema, including subscriptions. Reviewed Node integration uses ws and exposes disposable shutdown; raw application bytes and generic event protocols are different roles.",
      "asOf": "2026-11-19"
    },
    "F253": {
      "label": "Project function, graphql-ws",
      "display": "async function start() {\n  /** Create WS Server */\n  const wsServer = new WebSocketServer({\n    server: httpServer,\n    path: '/graphql',\n  })\n\n  /** hand-in created schema and have the WS Server start listening */\n  const serverCleanup = useServer({ schema, context }, wsServer)\n\n  const server = new ApolloServer<Context>({\n    schema,\n    plugins: [\n      ApolloServerPluginDrainHttpServer({ httpServer }),\n      {\n        async serverWillStart() {\n          return {\n            async drainServer() {\n              await serverCleanup.dispose()\n            },\n          }\n        },\n      },\n    ],\n  })\n\n  await server.start()\n  app.use('/graphql', cors<cors.CorsRequest>(), express.json(), expressMiddleware(server, { context: async () => context }));\n\n  httpServer.listen(PORT, () => {\n    console.log(`🚀 Server ready at http://localhost:${PORT}/graphql`)\n    console.log(`⏰ Subscriptions ready at http://localhost:${PORT}/graphql`)\n    console.log(\n      `⭐️ See sample queries: http://pris.ly/e/ts/graphql-subscriptions#using-the-graphql-api`,\n    )\n  })\n}\n",
      "asOf": "2026-11-19"
    },
    "F254": {
      "label": "Project source file, graphql-ws",
      "display": "orm/graphql-subscriptions/src/server.ts",
      "asOf": "2026-11-19"
    },
    "F255": {
      "label": "Project full_name, graphql-ws",
      "display": "prisma/prisma-examples",
      "asOf": "2026-11-19"
    },
    "F256": {
      "label": "Project stargazers_count, graphql-ws",
      "display": "6.7K",
      "asOf": "2026-11-19"
    },
    "F257": {
      "label": "Developer need, faye-websocket",
      "display": "WebSockets inside an existing HTTP server",
      "asOf": "2026-11-17"
    },
    "F258": {
      "label": "Pick reason, faye-websocket",
      "display": "handles upgrades on an existing Node.js server",
      "asOf": "2026-11-17"
    },
    "F259": {
      "label": "Developer need, websocket-driver",
      "display": "The protocol over a custom stream",
      "asOf": "2026-11-17"
    },
    "F260": {
      "label": "Pick reason, websocket-driver",
      "display": "runs the WebSocket protocol over any I/O stream",
      "asOf": "2026-11-17"
    },
    "F261": {
      "label": "Developer need, crossws",
      "display": "One server across runtimes",
      "asOf": "2026-11-17"
    },
    "F262": {
      "label": "Pick reason, crossws",
      "display": "runs the same hooks on Node.js, Bun, Deno, and Cloudflare Workers",
      "asOf": "2026-11-17"
    },
    "F263": {
      "label": "Developer need, engine.io",
      "display": "The transport under Socket.IO",
      "asOf": "2026-11-17"
    },
    "F264": {
      "label": "Pick reason, engine.io",
      "display": "starts on long-polling and upgrades to WebSocket",
      "asOf": "2026-11-17"
    },
    "F265": {
      "label": "Developer need, graphql-ws",
      "display": "GraphQL subscriptions",
      "asOf": "2026-11-17"
    },
    "F266": {
      "label": "Pick reason, graphql-ws",
      "display": "implements the GraphQL over WebSocket Protocol",
      "asOf": "2026-11-17"
    },
    "F267": {
      "label": "Strength lead, faye",
      "display": "Standard WebSocket API",
      "asOf": "2026-11-17"
    },
    "F268": {
      "label": "Strength body, faye",
      "display": "Sockets expose the same send, message, and close interface as the browser's WebSocket.",
      "asOf": "2026-11-17"
    },
    "F269": {
      "label": "Strength lead, faye",
      "display": "Handles EventSource too",
      "asOf": "2026-11-17"
    },
    "F270": {
      "label": "Strength body, faye",
      "display": "One-way EventSource streams push data to clients over plain HTTP.",
      "asOf": "2026-11-17"
    },
    "F271": {
      "label": "Limit lead, faye",
      "display": "No server of its own",
      "asOf": "2026-11-17"
    },
    "F272": {
      "label": "Limit body, faye",
      "display": "The app's HTTP server passes each upgrade request to the library.",
      "asOf": "2026-11-17"
    },
    "F273": {
      "label": "Strength lead, driver",
      "display": "Works over any stream",
      "asOf": "2026-11-17"
    },
    "F274": {
      "label": "Strength body, driver",
      "display": "The app moves bytes in and out, and the driver handles the protocol.",
      "asOf": "2026-11-17"
    },
    "F275": {
      "label": "Strength lead, driver",
      "display": "Answers pings itself",
      "asOf": "2026-11-17"
    },
    "F276": {
      "label": "Strength body, driver",
      "display": "Replies to ping frames, recombines fragments, and runs the closing handshake.",
      "asOf": "2026-11-17"
    },
    "F277": {
      "label": "Strength lead, crossws",
      "display": "One API on four runtimes",
      "asOf": "2026-11-17"
    },
    "F278": {
      "label": "Strength body, crossws",
      "display": "The same hooks run on Node.js, Bun, Deno, and Cloudflare Workers through adapters.",
      "asOf": "2026-11-17"
    },
    "F279": {
      "label": "Strength lead, crossws",
      "display": "Bundles ws for Node.js",
      "asOf": "2026-11-17"
    },
    "F280": {
      "label": "Strength body, crossws",
      "display": "The Node.js adapter ships with ws, and a uWebSockets adapter is also available.",
      "asOf": "2026-11-17"
    },
    "F281": {
      "label": "Strength lead, engine.io",
      "display": "Starts on long-polling",
      "asOf": "2026-11-17"
    },
    "F282": {
      "label": "Strength body, engine.io",
      "display": "Connections open over HTTP, then upgrade to WebSocket or WebTransport when they can.",
      "asOf": "2026-11-17"
    },
    "F283": {
      "label": "Strength lead, graphql-ws",
      "display": "No dependencies",
      "asOf": "2026-11-17"
    },
    "F284": {
      "label": "Strength body, graphql-ws",
      "display": "One package holds both the server and the client for the protocol.",
      "asOf": "2026-11-17"
    },
    "F285": {
      "label": "Limit lead, graphql-ws",
      "display": "Separate from the old protocol",
      "asOf": "2026-11-17"
    },
    "F286": {
      "label": "Limit body, graphql-ws",
      "display": "Clients built on subscriptions-transport-ws can't connect, so both sides have to switch.",
      "asOf": "2026-11-17"
    }
  },
  "dataCheckedAt": "2026-11-19",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best JavaScript WebSocket libraries ws Socket.IO SockJS WebSocket Node code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
