Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
The best WebSocket library for fast, small send size, binary protocols.
Long gone is Socket.io's slow and stringified packets.
const bws = require("bestws");
const server = new bws.Server(bws.new.HTTP(3000));
server.on("initialize", (ws, res, init, req) => {
console.log("Initial data received: ", init);
res(["I", { got: "the" }, "message", 1111, [",", "you", { may: "connect" }, true]]);
ws.on("message", (data) => {
console.log("Got data from client: ", data);
ws.send("Hello!");
});
});
server.on("listening", () => {
console.log("Listening.");
const client = new bws.Client("ws://localhost:3000", [1, { a: "Init request data" }, 2]);
client.on("initializing", () => console.log("Client connecting..."));
client.on("open", (init) => {
console.log("Server sent their own initial data: ", init);
client.send("Hi!");
});
client.on("message", (data) => {
console.log("Got data from server: ", data);
});
});
I didn't make the above work with browsers, NodeJS only.
Where this library shines if the encoding functionality which I haven't made in browser either, kinda too lazy for that. Have fun.
FAQs
Best WebSocket library, long gone are the days of the idiotic Socket.io
The npm package bestws receives a total of 0 weekly downloads. As such, bestws popularity was classified as not popular.
We found that bestws 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.