Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
node-multi-socketservers
Advanced tools
A multi http & socket servers manager, based on node-multi-webserver
A multi http and socket servers manager, based on node-multi-webserver
$ npm install node-multi-socketservers
see node-multi-webservers documentation for webservers management
connection(function eventListener) : return Promise instance
eventListener((socket[ , server ]) => {})
emit(string eventName[, mixed data]) : return Promise instance
broadcast(SocketIO.Socket socket, http.Server server, string eventName, [, mixed data]) : return Promise instance
broadcast on all servers
removeAllListeners(string|array eventNames) : return Promise instance
remove all listener of an event or an array of events for all the servers and sockets
const http = require("http"),
https = require("https"),
express = require("express"),
multiservers = require("node-multi-socketservers");
let servers = new multiservers(),
app = express().get("/", (req, res) => {
res.set("Content-Type", contentType).send(message);
});
return servers.addServer({
port: 80,
name: "http server"
}).then(() => {
return servers.addServer({
port: 443,
name: "secure server",
ssl: true,
key: "YOUR_PRIVATE_KEY",
cert: "YOUR_CERTIFICATE"
});
}).then(() => {
return servers.addServer({
port: 1337,
name: "admin server",
key: "YOUR_PRIVATE_KEY",
cert: "YOUR_CERTIFICATE"
});
}).then(() => {
return servers.setTimeout(2 * 1000);
}).then(() => {
return servers.listen(app);
}).then(() => {
return servers.connection((socket, server) => {
servers.broadcast(socket, server, "newconnection");
socket.on("disconnect", () => {
servers.broadcast(socket, server, "disconnection");
});
});
}).catch((err) => {
console.log(err);
servers.release().catch((err) => {
console.log(err);
});
});
const http = require("http"),
https = require("https"),
multiservers = require("node-multi-socketservers");
let servers = new multiservers();
return servers.addServer({
port: 80,
name: "http server"
}).then(() => {
return servers.addServer({
port: 443,
name: "secure server",
ssl: true,
key: "YOUR_PRIVATE_KEY",
cert: "YOUR_CERTIFICATE"
});
}).then(() => {
return servers.addServer({
port: 1337,
name: "admin server",
key: "YOUR_PRIVATE_KEY",
cert: "YOUR_CERTIFICATE"
});
}).then(() => {
return servers.setTimeout(2 * 1000);
}).then(() => {
return servers.listen((req, res) => {
res.writeHead(200, {"Content-Type": contentType});
res.end("hello world, from http:80, https:443 or https:1337");
});
}).then(() => {
return servers.connection((socket, server) => {
servers.broadcast(socket, server, "newconnection");
socket.on("disconnect", () => {
servers.broadcast(socket, server, "disconnection");
});
});
}).catch((err) => {
console.log(err);
servers.release().catch((err) => {
console.log(err);
});
});
$ gulp
FAQs
A multi http & socket servers manager, based on node-multi-webserver
The npm package node-multi-socketservers receives a total of 1 weekly downloads. As such, node-multi-socketservers popularity was classified as not popular.
We found that node-multi-socketservers 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.