
Security News
AI Slop Is Polluting Bug Bounty Platforms with Fake Vulnerability Reports
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
websocket-mockup
Advanced tools
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Mockup for websocket server and w3c websocket
npm i --save-dev websocket-mockup
Create a new websocket server mockup. You can pass a param.host
to be able to create different servers.
Will create a new websocket mockup in open state connected to this server
Event when a new websocket request is done, same API as the websocket server.
This is a shim of the W3C WebSocket intrface. It will connect to the WebSocketServerMockup which host
matches the url host portion or to the default (*
) one.
const {WebSocketServer,WebSocket} = require ("websocket-mockup");
const server = new WebSocketServer ({
host: "example.com"
});
server.on ("request", (request) => {
//Get protocol
const protocol = request.requestedProtocols[0];
//Accept the connection
const connection = request.accept (protocol, request.origin);
console.log ((new Date ()) + ' Connection accepted.');
connection.on ('message', function (message) {
if (message.type === 'utf8')
{
console.log ('Received Message: ' + message.utf8Data);
connection.sendUTF (message.utf8Data);
} else if (message.type === 'binary') {
console.log ('Received Binary Message of ' + message.binaryData.length + ' bytes');
connection.sendBytes (message.binaryData);
}
});
connection.on ('close', function (reasonCode, description) {
console.log ((new Date ()) + ' Peer ' + connection.remoteAddress + ' disconnected.');
});
});
const ws = new WebSocket("wss://example.com");
ws.onopen = (event) => {
console.log("opened");
ws.send("hi!");
};
ws.onclosed = (event) => console.log("closed");
ws.onerror = (event) => console.log(event);
ws.onmessage = (event) => {
console.log("message: "+event.data);
ws.close();
};
FAQs
Websocket server mockup
We found that websocket-mockup demonstrated a not healthy version release cadence and project activity because the last version was released 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
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
Research
Security News
The Socket Research team investigates a malicious Python package disguised as a Discord error logger that executes remote commands and exfiltrates data via a covert C2 channel.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.