
Security News
Security Community Slams MIT-linked Report Claiming AI Powers 80% of Ransomware
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.
@prsm/express-keepalive-ws
Advanced tools
This is a middleware that creates and exposes a `KeepAliveServer` instance (see [prsm/keepalive-ws](https://github.com/...).
This is a middleware that creates and exposes a KeepAliveServer instance (see prsm/keepalive-ws.
import express from "express";
import createWss, { type WSContext } from "@prsm/express-keepalive-ws";
const app = express();
const server = createServer(app);
const { middleware: ws, wss } = createWss({ /** ... */ });
app.use(ws);
// as a middleware:
app.use("/ws", async (req, res) => {
  if (req.ws) { // <-- req.ws will be defined if the request is a WebSocket request
    const ws = await req.ws(); // handle the upgrade and receive the client WebSocket
    ws.send("Hello WS!"); // send a message to the client
  } else {
    res.send("Hello HTTP!");
  }
});
// as a command server:
wss.registerCommand("echo", (c: WSContext) => {
  const { payload } = c;
  return `echo: ${payload}`;
});
Client-side usage (more at https://github.com/node-prism/keepalive-ws):
import { KeepAliveClient } from "@prsm/keepalive-ws/client";
const opts = { shouldReconnect: true };
const ws = new KeepAliveClient("ws://localhost:PORT", opts);
const echo = await ws.command("echo", "hello!");
console.log(echo); // "echo: hello!"
FAQs
This is a middleware that creates and exposes a `KeepAliveServer` instance (see [prsm/keepalive-ws](https://github.com/...).
We found that @prsm/express-keepalive-ws demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.